From 5e2d5f004722867a12d7c04a5c037615dd26b7db Mon Sep 17 00:00:00 2001 From: Amar Singhal Date: Fri, 6 Oct 2017 10:56:49 -0700 Subject: [PATCH] qcacld-3.0: Add check for wiphy band while populating it Wiphy band can be NULL since it is dynamically allocated depending on some condition. So check for NULL before populating it. CRs-Fixed: 2122279 Change-Id: If88045e2ebbb6bceb0ed3b5337cc70778b21f832 --- core/hdd/src/wlan_hdd_regulatory.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/hdd/src/wlan_hdd_regulatory.c b/core/hdd/src/wlan_hdd_regulatory.c index eda70a85197e..375b0a1dc7f0 100644 --- a/core/hdd/src/wlan_hdd_regulatory.c +++ b/core/hdd/src/wlan_hdd_regulatory.c @@ -835,6 +835,9 @@ static void fill_wiphy_band_channels(struct wiphy *wiphy, uint32_t chan_cnt; struct ieee80211_channel *wiphy_chan; + if (wiphy->bands[band_id] == NULL) + return; + wiphy_num_chan = wiphy->bands[band_id]->n_channels; wiphy_chan = wiphy->bands[band_id]->channels;