]> www.infradead.org Git - users/dwmw2/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Aug 2020 08:06:48 +0000 (10:06 +0200)
[ Upstream commit 728c1e2a05e4b5fc52fab3421dce772a806612a2 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ath/ath9k/wmi.c

index f57f48e4d7a0ab488e5a2dd685689b83495598f6..4b68804f3742ed486d0ddfe8a77194e42535ba5d 100644 (file)
@@ -338,6 +338,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;
        }