From e8ea09fe280f16372fe201845a1748dce666e998 Mon Sep 17 00:00:00 2001 From: Srinivas Pitla Date: Thu, 10 Feb 2022 09:28:44 -0800 Subject: [PATCH] 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 --- umac/mlo_mgr/src/wlan_mlo_mgr_aid.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/umac/mlo_mgr/src/wlan_mlo_mgr_aid.c b/umac/mlo_mgr/src/wlan_mlo_mgr_aid.c index 1ccbe65370..59c7b36be4 100644 --- a/umac/mlo_mgr/src/wlan_mlo_mgr_aid.c +++ b/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);