* [PATCH] ath10k: free wmi mgmt event skb when parsing fails
@ 2015-06-01 9:23 Raja Mani
2015-06-01 9:34 ` Michal Kazior
2015-06-09 10:52 ` Kalle Valo
0 siblings, 2 replies; 3+ messages in thread
From: Raja Mani @ 2015-06-01 9:23 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, ath10k, Raja Mani
When wmi mgmt event function fails to parse given skb,
it should be freed on failure condition to avoid memory
leaks. Found this during the code review.
Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/wmi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index b892eb8..818bd25 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -2089,6 +2089,7 @@ int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
ret = ath10k_wmi_pull_mgmt_rx(ar, skb, &arg);
if (ret) {
ath10k_warn(ar, "failed to parse mgmt rx event: %d\n", ret);
+ dev_kfree_skb(skb);
return ret;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ath10k: free wmi mgmt event skb when parsing fails
2015-06-01 9:23 [PATCH] ath10k: free wmi mgmt event skb when parsing fails Raja Mani
@ 2015-06-01 9:34 ` Michal Kazior
2015-06-09 10:52 ` Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Michal Kazior @ 2015-06-01 9:34 UTC (permalink / raw)
To: Raja Mani; +Cc: Kalle Valo, linux-wireless, ath10k@lists.infradead.org
On 1 June 2015 at 11:23, Raja Mani <rmani@qti.qualcomm.com> wrote:
> When wmi mgmt event function fails to parse given skb,
> it should be freed on failure condition to avoid memory
> leaks. Found this during the code review.
>
> Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
> ---
> drivers/net/wireless/ath/ath10k/wmi.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
> index b892eb8..818bd25 100644
> --- a/drivers/net/wireless/ath/ath10k/wmi.c
> +++ b/drivers/net/wireless/ath/ath10k/wmi.c
> @@ -2089,6 +2089,7 @@ int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
> ret = ath10k_wmi_pull_mgmt_rx(ar, skb, &arg);
> if (ret) {
> ath10k_warn(ar, "failed to parse mgmt rx event: %d\n", ret);
> + dev_kfree_skb(skb);
> return ret;
> }
Good catch! Looks good to me.
Michał
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ath10k: free wmi mgmt event skb when parsing fails
2015-06-01 9:23 [PATCH] ath10k: free wmi mgmt event skb when parsing fails Raja Mani
2015-06-01 9:34 ` Michal Kazior
@ 2015-06-09 10:52 ` Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2015-06-09 10:52 UTC (permalink / raw)
To: Raja Mani; +Cc: linux-wireless, ath10k
Raja Mani <rmani@qti.qualcomm.com> writes:
> When wmi mgmt event function fails to parse given skb,
> it should be freed on failure condition to avoid memory
> leaks. Found this during the code review.
>
> Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
Thanks, applied.
--
Kalle Valo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-06-09 10:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-01 9:23 [PATCH] ath10k: free wmi mgmt event skb when parsing fails Raja Mani
2015-06-01 9:34 ` Michal Kazior
2015-06-09 10:52 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).