diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2011-08-27 22:53:42 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-29 21:33:03 +0200 |
commit | 9a53bf54b8149bc1372f50a83b769f42772083ea (patch) | |
tree | e8f8a285416d0d6b7e6cb0a79cd751c017ed88e9 /drivers/net/wireless/b43 | |
parent | ath9k: Fix a smatch warnings (diff) | |
download | linux-9a53bf54b8149bc1372f50a83b769f42772083ea.tar.xz linux-9a53bf54b8149bc1372f50a83b769f42772083ea.zip |
b43: Fix swatch warning
Swatch reports the following warning for main.c:
CHECK drivers/net/wireless/b43/main.c
drivers/net/wireless/b43/main.c +4115 b43_wireless_core_stop(7) warn: variable dereferenced before check 'dev'
After analysis, this is not a bug, but a false warning. Nonetheless,
a cleanup is in order to prevent some future janitor proposing
the wrong fix, as I did in my original patch.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43')
-rw-r--r-- | drivers/net/wireless/b43/main.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index d2b1d1fe202b..172294170df8 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c @@ -4131,10 +4131,13 @@ out_unlock: * because the core might be gone away while we unlocked the mutex. */ static struct b43_wldev * b43_wireless_core_stop(struct b43_wldev *dev) { - struct b43_wl *wl = dev->wl; + struct b43_wl *wl; struct b43_wldev *orig_dev; u32 mask; + if (!dev) + return NULL; + wl = dev->wl; redo: if (!dev || b43_status(dev) < B43_STAT_STARTED) return dev; |