40b0630af81c3f176dd04ac880d59e06c021593d
[openwrt/staging/neocturne.git] /
1 From ed3f83b3459a67a3ab9d806490ac304b567b1c2d Mon Sep 17 00:00:00 2001
2 From: Miaoqian Lin <linmq006@gmail.com>
3 Date: Mon, 2 Jan 2023 12:11:42 +0400
4 Subject: [PATCH] wifi: ath11k: Fix memory leak in ath11k_peer_rx_frag_setup
5
6 crypto_alloc_shash() allocates resources, which should be released by
7 crypto_free_shash(). When ath11k_peer_find() fails, there has memory
8 leak. Add missing crypto_free_shash() to fix this.
9
10 Fixes: 243874c64c81 ("ath11k: handle RX fragments")
11 Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
12 Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
13 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
14 Link: https://lore.kernel.org/r/20230102081142.3937570-1-linmq006@gmail.com
15 ---
16 drivers/net/wireless/ath/ath11k/dp_rx.c | 1 +
17 1 file changed, 1 insertion(+)
18
19 --- a/drivers/net/wireless/ath/ath11k/dp_rx.c
20 +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
21 @@ -3126,6 +3126,7 @@ int ath11k_peer_rx_frag_setup(struct ath
22 if (!peer) {
23 ath11k_warn(ab, "failed to find the peer to set up fragment info\n");
24 spin_unlock_bh(&ab->base_lock);
25 + crypto_free_shash(tfm);
26 return -ENOENT;
27 }
28