Explorar o código

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 %!s(int64=6) %!d(string=hai) anos
pai
achega
52c060a2c4
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  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)) &&