summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mwifiex/cfg80211.c
diff options
context:
space:
mode:
authorXinming Hu <huxm@marvell.com>2015-09-18 06:32:07 -0700
committerKalle Valo <kvalo@codeaurora.org>2015-09-29 10:47:33 +0300
commit02421dd3f6af1b6becb6d9a690a2b70c73c03a7a (patch)
treecc6f94292ec9413dc08484fa827ccde5739848b4 /drivers/net/wireless/mwifiex/cfg80211.c
parent9a9053c3420fcc5779319e4ea267c6dcbf8d7c04 (diff)
downloadlwn-02421dd3f6af1b6becb6d9a690a2b70c73c03a7a.tar.gz
lwn-02421dd3f6af1b6becb6d9a690a2b70c73c03a7a.zip
mwifiex: NULL check for cfg80211_inform_bss()
cfg80211_inform_bss would return null in some cases, such as memory allocation failure. This patch adds sanity check for this case, to avoid possible issues when above corner case is hit. Signed-off-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/mwifiex/cfg80211.c')
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index d8143409da60..30cbafbd17c6 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1994,8 +1994,10 @@ static int mwifiex_cfg80211_inform_ibss_bss(struct mwifiex_private *priv)
CFG80211_BSS_FTYPE_UNKNOWN,
bss_info.bssid, 0, WLAN_CAPABILITY_IBSS,
0, ie_buf, ie_len, 0, GFP_KERNEL);
- cfg80211_put_bss(priv->wdev.wiphy, bss);
- memcpy(priv->cfg_bssid, bss_info.bssid, ETH_ALEN);
+ if (bss) {
+ cfg80211_put_bss(priv->wdev.wiphy, bss);
+ ether_addr_copy(priv->cfg_bssid, bss_info.bssid);
+ }
return 0;
}