Sfoglia il codice sorgente

qcacld-3.0: Check wma handler when get phy mode

Check NULL pointer in wma_chan_phy_mode.

Change-Id: I137433aa55cba182651f9e12bc5edca80b0b3bb7
CRs-Fixed: 2283243
Jiachao Wu 6 anni fa
parent
commit
52c060a2c4
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 5 0
      core/wma/src/wma_features.c

+ 5 - 0
core/wma/src/wma_features.c

@@ -668,6 +668,11 @@ WLAN_PHY_MODE wma_chan_phy_mode(u8 chan, enum phy_ch_width chan_width,
 	uint16_t bw_val = wlan_reg_get_bw_value(chan_width);
 	t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
 
+	if (!wma) {
+		WMA_LOGE("%s : wma_handle is NULL", __func__);
+		return MODE_UNKNOWN;
+	}
+
 	if (WLAN_REG_IS_24GHZ_CH(chan)) {
 		if (((CH_WIDTH_5MHZ == chan_width) ||
 		     (CH_WIDTH_10MHZ == chan_width)) &&