diff mbox series

ath11k: fix missing free of skb on error return path

Message ID 20191212194251.108343-1-colin.king@canonical.com (mailing list archive)
State Accepted
Commit 4358bcb54bb9ede559e60685b9e544e723197ca1
Delegated to: Kalle Valo
Headers show
Series ath11k: fix missing free of skb on error return path | expand

Commit Message

Colin King Dec. 12, 2019, 7:42 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The error handling when the call to ath11k_hal_srng_get_entrysize fails
leaks skb, fix this by returning via the err_free return path that will
ensure the skb is free'd.

Addresses-Coverity: ("Resource leak")
Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/wireless/ath/ath11k/dp_tx.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Kalle Valo Dec. 18, 2019, 5:54 p.m. UTC | #1
Colin King <colin.king@canonical.com> wrote:

> The error handling when the call to ath11k_hal_srng_get_entrysize fails
> leaks skb, fix this by returning via the err_free return path that will
> ensure the skb is free'd.
> 
> Addresses-Coverity: ("Resource leak")
> Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

4358bcb54bb9 ath11k: fix missing free of skb on error return path
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath11k/dp_tx.c b/drivers/net/wireless/ath/ath11k/dp_tx.c
index a8b9557c2346..7123a4fc4635 100644
--- a/drivers/net/wireless/ath/ath11k/dp_tx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
@@ -645,8 +645,10 @@  int ath11k_dp_tx_htt_srng_setup(struct ath11k_base *ab, u32 ring_id,
 				 HAL_ADDR_MSB_REG_SHIFT;
 
 	ret = ath11k_hal_srng_get_entrysize(ring_type);
-	if (ret < 0)
-		return -EINVAL;
+	if (ret < 0) {
+		ret = -EINVAL;
+		goto err_free;
+	}
 
 	ring_entry_sz = ret;