Skip to content

Commit 5a1210a

Browse files
P Praneeshgregkh
authored andcommitted
wifi: ath12k: Fix memory leak during vdev_id mismatch
[ Upstream commit 75ec94d ] Currently driver enables vdev_id check as part of the bank configuration in ath12k_dp_tx_get_vdev_bank_config(). This check ensures that the vdev_id configured in the bank register aligns with the vdev_id in the packet's address search table within the firmware. If there is a mismatch, the firmware forwards the packet with the HTT status HAL_WBM_REL_HTT_TX_COMP_STATUS_VDEVID_MISMATCH. Since driver does not handle this vdev_id mismatch HTT status, the corresponding buffers are not freed properly, causing a memory leak. Fix this issue by adding handling to free the buffers when a vdev_id mismatch HTT status is encountered. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ- Fixes: d889913 ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices") Signed-off-by: P Praneesh <praneesh.p@oss.qualcomm.com> Link: https://patch.msgid.link/20250402174032.2651221-1-praneesh.p@oss.qualcomm.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent f5d77d0 commit 5a1210a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

drivers/net/wireless/ath/ath12k/dp_tx.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ ath12k_dp_tx_process_htt_tx_complete(struct ath12k_base *ab,
566566
case HAL_WBM_REL_HTT_TX_COMP_STATUS_TTL:
567567
case HAL_WBM_REL_HTT_TX_COMP_STATUS_REINJ:
568568
case HAL_WBM_REL_HTT_TX_COMP_STATUS_INSPECT:
569+
case HAL_WBM_REL_HTT_TX_COMP_STATUS_VDEVID_MISMATCH:
569570
ath12k_dp_tx_free_txbuf(ab, msdu, mac_id, tx_ring);
570571
break;
571572
case HAL_WBM_REL_HTT_TX_COMP_STATUS_MEC_NOTIFY:

drivers/net/wireless/ath/ath12k/hal_desc.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* SPDX-License-Identifier: BSD-3-Clause-Clear */
22
/*
33
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
4-
* Copyright (c) 2021-2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved.
4+
* Copyright (c) 2021-2022, 2024-2025 Qualcomm Innovation Center, Inc. All rights reserved.
55
*/
66
#include "core.h"
77

@@ -1296,6 +1296,7 @@ enum hal_wbm_htt_tx_comp_status {
12961296
HAL_WBM_REL_HTT_TX_COMP_STATUS_REINJ,
12971297
HAL_WBM_REL_HTT_TX_COMP_STATUS_INSPECT,
12981298
HAL_WBM_REL_HTT_TX_COMP_STATUS_MEC_NOTIFY,
1299+
HAL_WBM_REL_HTT_TX_COMP_STATUS_VDEVID_MISMATCH,
12991300
HAL_WBM_REL_HTT_TX_COMP_STATUS_MAX,
13001301
};
13011302

0 commit comments

Comments
 (0)