* [PATCH wireless v2] brcmfmac: fix potential memory leak in brcmf_netdev_start_xmit()
@ 2022-11-17 11:33 Zhang Changzhong
2022-12-01 11:09 ` Arend van Spriel
2022-12-22 16:07 ` [wireless,v2] wifi: " Kalle Valo
0 siblings, 2 replies; 3+ messages in thread
From: Zhang Changzhong @ 2022-11-17 11:33 UTC (permalink / raw)
To: Arend van Spriel, Franky Lin, Hante Meuleman, Kalle Valo,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Pieter-Paul Giesberts
Cc: Zhang Changzhong, linux-wireless, brcm80211-dev-list.pdl,
SHA-cyfmac-dev-list, netdev, linux-kernel
The brcmf_netdev_start_xmit() returns NETDEV_TX_OK without freeing skb
in case of pskb_expand_head() fails, add dev_kfree_skb() to fix it.
Compile tested only.
Fixes: 270a6c1f65fe ("brcmfmac: rework headroom check in .start_xmit()")
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
---
v1->v2: add "Compile tested only" to commit log
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
index 595ae3a..175272c 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
@@ -335,6 +335,7 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb,
bphy_err(drvr, "%s: failed to expand headroom\n",
brcmf_ifname(ifp));
atomic_inc(&drvr->bus_if->stats.pktcow_failed);
+ dev_kfree_skb(skb);
goto done;
}
}
--
2.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH wireless v2] brcmfmac: fix potential memory leak in brcmf_netdev_start_xmit()
2022-11-17 11:33 [PATCH wireless v2] brcmfmac: fix potential memory leak in brcmf_netdev_start_xmit() Zhang Changzhong
@ 2022-12-01 11:09 ` Arend van Spriel
2022-12-22 16:07 ` [wireless,v2] wifi: " Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Arend van Spriel @ 2022-12-01 11:09 UTC (permalink / raw)
To: Zhang Changzhong, Arend van Spriel, Franky Lin, Hante Meuleman,
Kalle Valo, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Pieter-Paul Giesberts
Cc: linux-wireless, brcm80211-dev-list.pdl, SHA-cyfmac-dev-list,
netdev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 605 bytes --]
On 11/17/2022 12:33 PM, 'Zhang Changzhong' via BRCM80211-DEV-LIST,PDL wrote:
> The brcmf_netdev_start_xmit() returns NETDEV_TX_OK without freeing skb
> in case of pskb_expand_head() fails, add dev_kfree_skb() to fix it.
> Compile tested only.
>
> Fixes: 270a6c1f65fe ("brcmfmac: rework headroom check in .start_xmit()")
Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
> ---
> v1->v2: add "Compile tested only" to commit log
>
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 1 +
> 1 file changed, 1 insertion(+)
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4219 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [wireless,v2] wifi: brcmfmac: fix potential memory leak in brcmf_netdev_start_xmit()
2022-11-17 11:33 [PATCH wireless v2] brcmfmac: fix potential memory leak in brcmf_netdev_start_xmit() Zhang Changzhong
2022-12-01 11:09 ` Arend van Spriel
@ 2022-12-22 16:07 ` Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2022-12-22 16:07 UTC (permalink / raw)
To: Zhang Changzhong
Cc: Arend van Spriel, Franky Lin, Hante Meuleman, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Pieter-Paul Giesberts,
Zhang Changzhong, linux-wireless, brcm80211-dev-list.pdl,
SHA-cyfmac-dev-list, netdev, linux-kernel
Zhang Changzhong <zhangchangzhong@huawei.com> wrote:
> The brcmf_netdev_start_xmit() returns NETDEV_TX_OK without freeing skb
> in case of pskb_expand_head() fails, add dev_kfree_skb() to fix it.
> Compile tested only.
>
> Fixes: 270a6c1f65fe ("brcmfmac: rework headroom check in .start_xmit()")
> Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
> Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Patch applied to wireless-next.git, thanks.
212fde3fe76e wifi: brcmfmac: fix potential memory leak in brcmf_netdev_start_xmit()
--
https://patchwork.kernel.org/project/linux-wireless/patch/1668684782-47422-1-git-send-email-zhangchangzhong@huawei.com/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-12-22 16:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-17 11:33 [PATCH wireless v2] brcmfmac: fix potential memory leak in brcmf_netdev_start_xmit() Zhang Changzhong
2022-12-01 11:09 ` Arend van Spriel
2022-12-22 16:07 ` [wireless,v2] wifi: " Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox