Jelajahi Sumber

qcacld-3.0: Fix possible uninitialized variable access in wma_add_bss_sta_mode

In function wma_add_bss_sta_mode, variable "peer" is not initialized.
Possibly we may pass this variable to wma_remove_peer function as is
and that can be dereferenced inside wma_remove_peer function.

So initialize peer with NULL to avoid dereferencing uninitialized variable.

Change-Id: Ibc484759b5e92052a3500137464e47287ccad939
CRs-Fixed: 1042968
Arif Hussain 8 tahun lalu
induk
melakukan
89697c49b0
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      core/wma/src/wma_dev_if.c

+ 1 - 1
core/wma/src/wma_dev_if.c

@@ -2977,7 +2977,7 @@ static void wma_add_bss_sta_mode(tp_wma_handle wma, tpAddBssParams add_bss)
 	struct wma_vdev_start_req req;
 	struct wma_target_req *msg;
 	uint8_t vdev_id, peer_id;
-	ol_txrx_peer_handle peer;
+	ol_txrx_peer_handle peer = NULL;
 	QDF_STATUS status;
 	struct wma_txrx_node *iface;
 	int pps_val = 0;