Explorar o código

qcacld-3.0: Initialize stack variable before use

A possible case of accessing @peer variable
uninitialized in wlan_hdd_add_key_all_mlo_vdev() API
when the device mode is SAP but the VDEV is not MLO type.

Initialize the variable to default value to fix the issue.

Change-Id: Ie35333e581cadb7d5e269bc12a52ecbf7260aece
CRs-Fixed: 3341891
Vinod Kumar Pirla %!s(int64=2) %!d(string=hai) anos
pai
achega
e0a52aadcd
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      core/hdd/src/wlan_hdd_cfg80211.c

+ 1 - 1
core/hdd/src/wlan_hdd_cfg80211.c

@@ -20777,9 +20777,9 @@ static int wlan_hdd_add_key_all_mlo_vdev(mac_handle_t mac_handle,
 	struct hdd_adapter *link_adapter;
 	struct hdd_context *hdd_ctx;
 	struct wlan_objmgr_vdev *wlan_vdev_list[WLAN_UMAC_MLO_MAX_VDEVS];
-	struct wlan_objmgr_peer *peer;
 	struct wlan_objmgr_vdev *link_vdev;
 	struct qdf_mac_addr peer_mac;
+	struct wlan_objmgr_peer *peer = NULL;
 	int errno = 0;
 	uint16_t link, vdev_count = 0;