Browse Source

qcacld-3.0: Fix potential uninitialized peer might be used directly

The uninitialized peer might be used directly if device mode is SAP mode
and the link_vdev is not mlo vdev in the wlan_hdd_add_key_all_mlo_vdev.

Init the peer to NULL before checking the each link_vdev to address this
potential issue.

Change-Id: Ifbf2b68a030fada8a2a1b1cacf5d2a6ef703befe
CRs-Fixed: 3344320
Tiger Yu 2 years ago
parent
commit
a98c209617
1 changed files with 1 additions and 0 deletions
  1. 1 0
      core/hdd/src/wlan_hdd_cfg80211.c

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

@@ -20822,6 +20822,7 @@ static int wlan_hdd_add_key_all_mlo_vdev(mac_handle_t mac_handle,
 			mlo_release_vdev_ref(link_vdev);
 			continue;
 		}
+		peer = NULL;
 		switch (adapter->device_mode) {
 		case QDF_SAP_MODE:
 			if (wlan_vdev_mlme_is_mlo_vdev(link_vdev))