summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorMursalin Akon <makon@nvidia.com>2012-09-07 10:57:02 -0700
committerMatthew Pedro <mapedro@nvidia.com>2012-10-04 15:39:15 -0700
commita4a73f7bc48e771e493e6e363e5c323ce8513ae9 (patch)
treefb6f326baae081198bd769c95e1acbebe9d8d554 /drivers/net
parent3ae23c3dab9151cca239513888d55146515931c1 (diff)
bcmdhd: use the wiphy from private data structure (i.e., wl_priv)
problem: The macro wiphy_from_scan retrieves wiphy from wl_priv->escan_info.wiphy which is in turn set by a 'scan' initiated from kernel space (like scheduled scan) or from user space (like iwlist command). Without a scan, a 'connect' crashes in function wl_inform_single_bss, with NULL pointer access, as the variable wiphy (in turn, wl->escan_info.wiphy) is not initialized properly. solution: wireless_device data structures maintained for both STA and P2P mode point to the same wiphy (see, wl_cfgp2p_register_ndev in wl_cfgp2p.c). So, irrespective of whatever wireless_device is in use, a scan will always set wl_priv->escan_info.wiphy to the same wiphy. There is no point in getting wiphy using wl_priv->escan_info.wiphy, rather use the wiphy referred by all wireless_device structures. Bug 1029792 Bug 1029733 Change-Id: I6d744950d3a053642ffa998b3c3f3ba60c0cb687 Signed-off-by: Mursalin Akon <makon@nvidia.com> Reviewed-on: http://git-master/r/141629 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Matthew Pedro <mapedro@nvidia.com> GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/bcmdhd/wl_cfg80211.c2
-rw-r--r--drivers/net/wireless/bcmdhd/wl_cfg80211.h1
2 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/wireless/bcmdhd/wl_cfg80211.c b/drivers/net/wireless/bcmdhd/wl_cfg80211.c
index 7f3e332dbfce..2c4e9a63dd9e 100644
--- a/drivers/net/wireless/bcmdhd/wl_cfg80211.c
+++ b/drivers/net/wireless/bcmdhd/wl_cfg80211.c
@@ -4693,7 +4693,7 @@ static s32 wl_inform_bss(struct wl_priv *wl)
static s32 wl_inform_single_bss(struct wl_priv *wl, struct wl_bss_info *bi)
{
- struct wiphy *wiphy = wiphy_from_scan(wl);
+ struct wiphy *wiphy = wl_to_wiphy(wl);
struct ieee80211_mgmt *mgmt;
struct ieee80211_channel *channel;
struct ieee80211_supported_band *band;
diff --git a/drivers/net/wireless/bcmdhd/wl_cfg80211.h b/drivers/net/wireless/bcmdhd/wl_cfg80211.h
index 37c8e5850c44..21446dc10708 100644
--- a/drivers/net/wireless/bcmdhd/wl_cfg80211.h
+++ b/drivers/net/wireless/bcmdhd/wl_cfg80211.h
@@ -612,7 +612,6 @@ wl_get_profile_by_netdev(struct wl_priv *wl, struct net_device *ndev)
#define iscan_to_wl(i) ((struct wl_priv *)(i->data))
#define wl_to_iscan(w) (w->iscan)
#define wl_to_conn(w) (&w->conn_info)
-#define wiphy_from_scan(w) (w->escan_info.wiphy)
#define wl_get_drv_status_all(wl, stat) \
(wl_get_status_all(wl, WL_STATUS_ ## stat))
#define wl_get_drv_status(wl, stat, ndev) \