From: Raja Mani Date: Mon, 1 Jun 2015 09:23:33 +0000 (+0530) Subject: ath10k: free wmi mgmt event skb when parsing fails X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=08603f2e1c31839510747899a5e0b9448b502ee0;p=linux-beck.git ath10k: free wmi mgmt event skb when parsing fails 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 Signed-off-by: Kalle Valo --- diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 77220b0f0e89..226bd2141629 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -1451,6 +1451,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; }