Sfoglia il codice sorgente

qcacmn: Fix static analysis issue in ML AID free

This change handles the scenario,if the caller passes invalid
link ix during AID free

Change-Id: I494cb55573ea5d8ecd351aac454d3395710273c1
CRs-Fixed: 3127458
Srinivas Pitla 3 anni fa
parent
commit
e8ea09fe28
1 ha cambiato i file con 10 aggiunte e 4 eliminazioni
  1. 10 4
      umac/mlo_mgr/src/wlan_mlo_mgr_aid.c

+ 10 - 4
umac/mlo_mgr/src/wlan_mlo_mgr_aid.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -277,9 +277,15 @@ QDF_STATUS wlan_mlo_peer_free_aid(
 			}
 		}
 	} else {
-		vdev_aid_mgr = ml_aid_mgr->aid_mgr[link_ix];
-		if (vdev_aid_mgr)
-			qdf_clear_bit(assoc_id_ix, vdev_aid_mgr->aid_bitmap);
+		if ((link_ix != 0xff) && (link_ix < WLAN_UMAC_MLO_MAX_VDEVS)) {
+			vdev_aid_mgr = ml_aid_mgr->aid_mgr[link_ix];
+			if (vdev_aid_mgr)
+				qdf_clear_bit(assoc_id_ix,
+					      vdev_aid_mgr->aid_bitmap);
+		} else {
+			mlo_err("AID free failed, link ix(%d) is invalid for assoc_id %d",
+				link_ix, assoc_id);
+		}
 	}
 
 	ml_aid_lock_release(mlo_mgr_ctx);