diff options
| author | SaidiReddy Yenuga <saidir@codeaurora.org> | 2016-08-24 13:17:33 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-08-24 14:29:54 +0530 |
| commit | 36d5189babe8ea9f4a525d199180a617fbd98495 (patch) | |
| tree | 242cfa37b8858a4940520528b2a0551a8a5a44d7 | |
| parent | cd5e65dd9fd2f7aecfe9ba28e977375c930f2a96 (diff) | |
qcacld-2.0: Add NULL check for wiphy 5G band pointer
When the dot11Mode set to eHDD_DOT11_MODE_11g_ONLY in ini file,
5G band pointer in wiphy structure does not get initialized.
The same pointer access result in crash.
Add NULL check for wiphy 5G band pointer.
CRs-Fixed: 1055191
Change-Id: Iebc72c557f26bc776337730bd8349e47f2056d07
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg80211.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index c9597258c8da..1ccf95085233 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -12369,10 +12369,12 @@ void wlan_hdd_update_wiphy(struct wiphy *wiphy, ht_cap_info = (tSirMacHTCapabilityInfo *)&val16; if (ht_cap_info->txSTBC == TRUE) { - wiphy->bands[IEEE80211_BAND_2GHZ]->ht_cap.cap |= - IEEE80211_HT_CAP_TX_STBC; - wiphy->bands[IEEE80211_BAND_5GHZ]->ht_cap.cap |= - IEEE80211_HT_CAP_TX_STBC; + if (NULL != wiphy->bands[IEEE80211_BAND_2GHZ]) + wiphy->bands[IEEE80211_BAND_2GHZ]->ht_cap.cap |= + IEEE80211_HT_CAP_TX_STBC; + if (NULL != wiphy->bands[IEEE80211_BAND_5GHZ]) + wiphy->bands[IEEE80211_BAND_5GHZ]->ht_cap.cap |= + IEEE80211_HT_CAP_TX_STBC; } } |
