Prechádzať zdrojové kódy

qcacld-3.0: NULL pointer may be dereferenced

Pointer 'chan' checked for NULL will be dereferenced

Change-Id: If5137767a78ac3166d5ae03cb741caefc895bd99
CRs-Fixed: 2757250
Jianmin Zhu 4 rokov pred
rodič
commit
56ad1a9fbc
1 zmenil súbory, kde vykonal 7 pridanie a 3 odobranie
  1. 7 3
      core/wma/src/wma_scan_roam.c

+ 7 - 3
core/wma/src/wma_scan_roam.c

@@ -2872,10 +2872,14 @@ static void wma_update_phymode_on_roam(tp_wma_handle wma, uint8_t *bssid,
 	des_chan = wlan_vdev_mlme_get_des_chan(iface->vdev);
 	bss_chan = wlan_vdev_mlme_get_bss_chan(iface->vdev);
 	des_chan->ch_phymode = bss_phymode;
-	des_chan->ch_freq = chan->mhz;
-	des_chan->ch_cfreq1 = chan->band_center_freq1;
-	des_chan->ch_cfreq2 = chan->band_center_freq2;
 	des_chan->ch_width = iface->chan_width;
+	if (chan) {
+		des_chan->ch_freq = chan->mhz;
+		des_chan->ch_cfreq1 = chan->band_center_freq1;
+		des_chan->ch_cfreq2 = chan->band_center_freq2;
+	} else {
+		wma_err("LFR3: invalid chan");
+	}
 	qdf_mem_copy(bss_chan, des_chan, sizeof(struct wlan_channel));
 
 	if (!vdev_mlme)