Browse Source

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
Amar Singhal 7 năm trước cách đây
mục cha
commit
5e2d5f0047
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      core/hdd/src/wlan_hdd_regulatory.c

+ 3 - 0
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;