* [PATCH] qtnfmac: fix resource leaks on unsupported iftype error return path
@ 2020-09-25 13:22 Colin King
2020-09-29 8:24 ` Kalle Valo
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2020-09-25 13:22 UTC (permalink / raw)
To: Igor Mitsyanko, Sergey Matyukevich, Kalle Valo, David S . Miller,
Jakub Kicinski, Avinash Patil, linux-wireless, netdev
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
Currently if an unsupported iftype is detected the error return path
does not free the cmd_skb leading to a resource leak. Fix this by
free'ing cmd_skb.
Addresses-Coverity: ("Resource leak")
Fixes: 805b28c05c8e ("qtnfmac: prepare for AP_VLAN interface type support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/net/wireless/quantenna/qtnfmac/commands.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c
index f40d8c3c3d9e..f3ccbd2b1084 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/commands.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c
@@ -869,6 +869,7 @@ int qtnf_cmd_send_del_intf(struct qtnf_vif *vif)
default:
pr_warn("VIF%u.%u: unsupported iftype %d\n", vif->mac->macid,
vif->vifid, vif->wdev.iftype);
+ dev_kfree_skb(cmd_skb);
ret = -EINVAL;
goto out;
}
@@ -1924,6 +1925,7 @@ int qtnf_cmd_send_change_sta(struct qtnf_vif *vif, const u8 *mac,
break;
default:
pr_err("unsupported iftype %d\n", vif->wdev.iftype);
+ dev_kfree_skb(cmd_skb);
ret = -EINVAL;
goto out;
}
--
2.27.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] qtnfmac: fix resource leaks on unsupported iftype error return path
2020-09-25 13:22 [PATCH] qtnfmac: fix resource leaks on unsupported iftype error return path Colin King
@ 2020-09-29 8:24 ` Kalle Valo
0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2020-09-29 8:24 UTC (permalink / raw)
To: Colin King
Cc: Igor Mitsyanko, Sergey Matyukevich, David S . Miller,
Jakub Kicinski, Avinash Patil, linux-wireless, netdev,
kernel-janitors, linux-kernel
Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Currently if an unsupported iftype is detected the error return path
> does not free the cmd_skb leading to a resource leak. Fix this by
> free'ing cmd_skb.
>
> Addresses-Coverity: ("Resource leak")
> Fixes: 805b28c05c8e ("qtnfmac: prepare for AP_VLAN interface type support")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Patch applied to wireless-drivers-next.git, thanks.
63f6982075d8 qtnfmac: fix resource leaks on unsupported iftype error return path
--
https://patchwork.kernel.org/patch/11799775/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-29 8:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-25 13:22 [PATCH] qtnfmac: fix resource leaks on unsupported iftype error return path Colin King
2020-09-29 8:24 ` 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).