ath10k: free wmi mgmt event skb when parsing fails
authorRaja Mani <rmani@qti.qualcomm.com>
Mon, 1 Jun 2015 09:23:33 +0000 (14:53 +0530)
committerKalle Valo <kvalo@qca.qualcomm.com>
Tue, 9 Jun 2015 10:40:42 +0000 (13:40 +0300)
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>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/wmi.c

index 77220b0f0e897fe44188c00b8dea1f3747ced9ed..226bd2141629b5a9ccd0653ff6264482c0c700e2 100644 (file)
@@ -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;
        }