Skip to content

Commit

Permalink
wifi: ath11k: Fix memory leak in ath11k_peer_rx_frag_setup
Browse files Browse the repository at this point in the history
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: 243874c ("ath11k: handle RX fragments")
Signed-off-by: Miaoqian Lin <[email protected]>
Reviewed-by: Leon Romanovsky <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
Yuuoniy authored and kvalo committed Jan 18, 2023
1 parent 53a998c commit ed3f83b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/wireless/ath/ath11k/dp_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -3126,6 +3126,7 @@ int ath11k_peer_rx_frag_setup(struct ath11k *ar, const u8 *peer_mac, int vdev_id
if (!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;
}

Expand Down

0 comments on commit ed3f83b

Please sign in to comment.