Browse Source

qcacld-3.0: Add pointer sanity check in wma_post_chan_switch_setup

Add pointer sanity check in wma_post_chan_switch_setup

Change-Id: I2972d033605895b0fe626593854798b112621eab
CRs-Fixed: 2706172
Utkarsh Bhatnagar 4 years ago
parent
commit
4d345a3488
1 changed files with 10 additions and 1 deletions
  1. 10 1
      core/wma/src/wma_scan_roam.c

+ 10 - 1
core/wma/src/wma_scan_roam.c

@@ -4261,11 +4261,20 @@ QDF_STATUS wma_pre_chan_switch_setup(uint8_t vdev_id)
 QDF_STATUS wma_post_chan_switch_setup(uint8_t vdev_id)
 {
 	tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
-	struct wma_txrx_node *intr = &wma->interfaces[vdev_id];
+	struct wma_txrx_node *intr;
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 	struct wlan_channel *des_chan;
 	cdp_config_param_type val;
 
+	if (!wma) {
+		pe_err("wma is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+	intr = &wma->interfaces[vdev_id];
+	if (!intr) {
+		pe_err("wma txrx node is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
 	/*
 	 * Record monitor mode channel here in case HW
 	 * indicate RX PPDU TLV with invalid channel number.