]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ath9k: release allocated buffer if timed out
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Fri, 6 Sep 2019 18:59:30 +0000 (13:59 -0500)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 10 Sep 2019 13:31:40 +0000 (16:31 +0300)
In ath9k_wmi_cmd, the allocated network buffer needs to be released
if timeout happens. Otherwise memory will be leaked.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath9k/wmi.c

index d1f6710ca63bdab330f09634ea9bdb3f3b4b02d8..cdc146091194828af19d3ba984b56e3928ced896 100644 (file)
@@ -336,6 +336,7 @@ int ath9k_wmi_cmd(struct wmi *wmi, enum wmi_cmd_id cmd_id,
                ath_dbg(common, WMI, "Timeout waiting for WMI command: %s\n",
                        wmi_cmd_to_name(cmd_id));
                mutex_unlock(&wmi->op_mutex);
+               kfree_skb(skb);
                return -ETIMEDOUT;
        }