diff options
author | Emil Goode <emilgoode@gmail.com> | 2012-09-18 18:04:07 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-19 09:28:14 +0100 |
commit | 5d5d7c3b938d0c365e65180f2b9d6ffad4973cee (patch) | |
tree | 4aff2e3142e00fbab9ba1fc097b40da604d8d3bf /drivers/staging/wlan-ng | |
parent | 3d9562a6ed5389cd92deafa3e357e197b1ff136d (diff) | |
download | op-kernel-dev-5d5d7c3b938d0c365e65180f2b9d6ffad4973cee.zip op-kernel-dev-5d5d7c3b938d0c365e65180f2b9d6ffad4973cee.tar.gz |
staging: wlan-ng: Fix dereference before NULL check
Smatch is warning about a dereference before we check for NULL.
This patch moves the dereference to after the NULL check.
Smatch warning:
drivers/staging/wlan-ng/cfg80211.c:345 prism2_scan() warn:
variable dereferenced before check 'request' (see line 332)
Signed-off-by: Emil Goode <emilgoode@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wlan-ng')
-rw-r--r-- | drivers/staging/wlan-ng/cfg80211.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c index 0970127..57a2b05 100644 --- a/drivers/staging/wlan-ng/cfg80211.c +++ b/drivers/staging/wlan-ng/cfg80211.c @@ -329,9 +329,9 @@ int prism2_get_station(struct wiphy *wiphy, struct net_device *dev, int prism2_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request) { - struct net_device *dev = request->wdev->netdev; + struct net_device *dev; struct prism2_wiphy_private *priv = wiphy_priv(wiphy); - wlandevice_t *wlandev = dev->ml_priv; + wlandevice_t *wlandev; struct p80211msg_dot11req_scan msg1; struct p80211msg_dot11req_scan_results msg2; struct cfg80211_bss *bss; @@ -345,6 +345,9 @@ int prism2_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request) if (!request) return -EINVAL; + dev = request->wdev->netdev; + wlandev = dev->ml_priv; + if (priv->scan_request && priv->scan_request != request) return -EBUSY; |