From 85edf16384d12db938a09458d89662cdff87068e Mon Sep 17 00:00:00 2001 From: Rameshkumar Sundaram Date: Tue, 26 Nov 2024 19:11:34 +0200 Subject: [PATCH] wifi: ath12k: ath12k_mac_station_add(): fix potential rx_stats leak If peer creation fails ar->rx_stats needs to be freed in error handling. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Signed-off-by: Rameshkumar Sundaram Signed-off-by: Kalle Valo Link: https://patch.msgid.link/20241126171139.2350704-6-kvalo@kernel.org --- drivers/net/wireless/ath/ath12k/mac.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index ec8209f17261..0b9dd50959e6 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -5308,6 +5308,8 @@ static int ath12k_mac_station_add(struct ath12k *ar, free_peer: ath12k_peer_delete(ar, arvif->vdev_id, arsta->addr); + kfree(arsta->rx_stats); + arsta->rx_stats = NULL; dec_num_station: ath12k_mac_dec_num_stations(arvif, arsta); exit: -- 2.25.1