wifi: ath11k: Fix memory leak in ath11k_peer_rx_frag_setup
Subsystems (3)
PATCH v2 1/1 wifi: ath11k: Fix memory leak in ath11k_peer_rx_frag_setup
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.
---
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(+)
drivers/net/wireless/ath/ath11k/dp_rx.c +1 -0
@@ -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 ; }
Signature · 1 line
2.25.1
Quoted 6 lines · Miaoqian Lin
crypto_alloc_shash()allocates resources, which should be released bycrypto_free_shash(). Whenath11k_peer_find()fails, there has memory leak. Add missingcrypto_free_shash()to fix this.Fixes 243874c64c81 ("ath11k: handle RX fragments")Signed-off-by Miaoqian Lin <[email protected]>
Quoted 8 lines
---
change in v2:
- addcrypto_free_shash()in the error path instead of movecrypto_alloc_shash().--- drivers/net/wireless/ath/ath11k/dp_rx.c | 1 + 1 file changed, 1 insertion(+)
Thanks,
Quoted 8 lines · Miaoqian Lin
crypto_alloc_shash()allocates resources, which should be released bycrypto_free_shash(). Whenath11k_peer_find()fails, there has memory leak. Add missingcrypto_free_shash()to fix this.Fixes 243874c64c81 ("ath11k: handle RX fragments")Signed-off-by Miaoqian Lin <[email protected]>Reviewed-by Leon Romanovsky <[email protected]>Signed-off-by Kalle Valo <[email protected]>
Patch applied to ath-next branch of ath.git, thanks.
ed3f83b3459a wifi: ath11k: Fix memory leak in ath11k_peer_rx_frag_setup
Signature · 9 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k