From: Miaoqian Lin <hidden> Date: 2023-01-02 08:11:59
crypto_alloc_shash() allocates resources, which should be released by
crypto_free_shash(). When ath11k_peer_find() fails, there has memory
leak. Add missing crypto_free_shash() to fix this.
Fixes: 243874c64c81 ("ath11k: handle RX fragments")
Signed-off-by: Miaoqian Lin <redacted>
---
change in v2:
- add crypto_free_shash() in the error path instead of move
crypto_alloc_shash().
---
drivers/net/wireless/ath/ath11k/dp_rx.c | 1 +
1 file changed, 1 insertion(+)
@@ -3126,6 +3126,7 @@ int ath11k_peer_rx_frag_setup(struct ath11k *ar, const u8 *peer_mac, int vdev_idif(!peer){ath11k_warn(ab,"failed to find the peer to set up fragment info\n");spin_unlock_bh(&ab->base_lock);+crypto_free_shash(tfm);return-ENOENT;}
From: Leon Romanovsky <leon@kernel.org> Date: 2023-01-03 09:22:04
On Mon, Jan 02, 2023 at 12:11:42PM +0400, Miaoqian Lin wrote:
crypto_alloc_shash() allocates resources, which should be released by
crypto_free_shash(). When ath11k_peer_find() fails, there has memory
leak. Add missing crypto_free_shash() to fix this.
Fixes: 243874c64c81 ("ath11k: handle RX fragments")
Signed-off-by: Miaoqian Lin <redacted>
---
change in v2:
- add crypto_free_shash() in the error path instead of move
crypto_alloc_shash().
---
drivers/net/wireless/ath/ath11k/dp_rx.c | 1 +
1 file changed, 1 insertion(+)
Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
From: Kalle Valo <kvalo@kernel.org> Date: 2023-01-18 07:09:37
Miaoqian Lin [off-list ref] wrote:
crypto_alloc_shash() allocates resources, which should be released by
crypto_free_shash(). When ath11k_peer_find() fails, there has memory
leak. Add missing crypto_free_shash() to fix this.
Fixes: 243874c64c81 ("ath11k: handle RX fragments")
Signed-off-by: Miaoqian Lin <redacted>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Kalle Valo <redacted>