Commit 02421dd3 authored by Xinming Hu's avatar Xinming Hu Committed by Kalle Valo

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: default avatarXinming Hu <huxm@marvell.com>
Signed-off-by: default avatarAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 9a9053c3
...@@ -1994,8 +1994,10 @@ static int mwifiex_cfg80211_inform_ibss_bss(struct mwifiex_private *priv) ...@@ -1994,8 +1994,10 @@ static int mwifiex_cfg80211_inform_ibss_bss(struct mwifiex_private *priv)
CFG80211_BSS_FTYPE_UNKNOWN, CFG80211_BSS_FTYPE_UNKNOWN,
bss_info.bssid, 0, WLAN_CAPABILITY_IBSS, bss_info.bssid, 0, WLAN_CAPABILITY_IBSS,
0, ie_buf, ie_len, 0, GFP_KERNEL); 0, ie_buf, ie_len, 0, GFP_KERNEL);
cfg80211_put_bss(priv->wdev.wiphy, bss); if (bss) {
memcpy(priv->cfg_bssid, bss_info.bssid, ETH_ALEN); cfg80211_put_bss(priv->wdev.wiphy, bss);
ether_addr_copy(priv->cfg_bssid, bss_info.bssid);
}
return 0; return 0;
} }
......
...@@ -1839,14 +1839,18 @@ mwifiex_parse_single_response_buf(struct mwifiex_private *priv, u8 **bss_info, ...@@ -1839,14 +1839,18 @@ mwifiex_parse_single_response_buf(struct mwifiex_private *priv, u8 **bss_info,
bssid, timestamp, bssid, timestamp,
cap_info_bitmap, beacon_period, cap_info_bitmap, beacon_period,
ie_buf, ie_len, rssi, GFP_KERNEL); ie_buf, ie_len, rssi, GFP_KERNEL);
bss_priv = (struct mwifiex_bss_priv *)bss->priv; if (bss) {
bss_priv->band = band; bss_priv = (struct mwifiex_bss_priv *)bss->priv;
bss_priv->fw_tsf = fw_tsf; bss_priv->band = band;
if (priv->media_connected && bss_priv->fw_tsf = fw_tsf;
!memcmp(bssid, priv->curr_bss_params.bss_descriptor if (priv->media_connected &&
.mac_address, ETH_ALEN)) !memcmp(bssid, priv->curr_bss_params.
mwifiex_update_curr_bss_params(priv, bss); bss_descriptor.mac_address,
cfg80211_put_bss(priv->wdev.wiphy, bss); ETH_ALEN))
mwifiex_update_curr_bss_params(priv,
bss);
cfg80211_put_bss(priv->wdev.wiphy, bss);
}
if ((chan->flags & IEEE80211_CHAN_RADAR) || if ((chan->flags & IEEE80211_CHAN_RADAR) ||
(chan->flags & IEEE80211_CHAN_NO_IR)) { (chan->flags & IEEE80211_CHAN_NO_IR)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment