diff options
author | Ido Yariv | 2011-08-22 23:19:49 +0300 |
---|---|---|
committer | John W. Linville | 2011-08-23 15:54:20 -0400 |
commit | a15f1c45f393982196c981a8df8b534cc9f3bb80 (patch) | |
tree | 17ba9fc6d943fb95f933673bdb5f206f7b858284 /net/x25 | |
parent | 80900d0140a7648587982c8f299830e900e49165 (diff) |
wl12xx: Fix validation of pm_runtime_get_sync return value
wl1271_sdio_power_on checks if the return value of pm_runtime_get_sync
is non-zero, and if so bails out.
However, pm_runtime_get_sync can return a positive number which does not
suggest an error has occurred. This is problematic for two reasons:
1. The function will needlessly bail out without decrementing back the
runtime PM reference counter.
2. wl1271_power_on only checks if wl1271_power_on return value is
negative. This means that wl1271_power_on will continue even if
wl1271_sdio_power_on bailed out. As a result, sdio transactions will
be initiated without properly enabling the sdio function and claiming
the host. This could even lead to a kernel panic.
Fix this by only checking that the return value of pm_runtime_get_sync
is non-negative.
Signed-off-by: Ido Yariv <ido@wizery.com>
Acked-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/x25')
0 files changed, 0 insertions, 0 deletions