Skip to content

Commit 212fde3

Browse files
Zhang ChangzhongKalle Valo
authored andcommitted
wifi: brcmfmac: fix potential memory leak in brcmf_netdev_start_xmit()
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: 270a6c1 ("brcmfmac: rework headroom check in .start_xmit()") Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com> Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/1668684782-47422-1-git-send-email-zhangchangzhong@huawei.com
1 parent 0a06cad commit 212fde3

File tree

1 file changed

+1
-0
lines changed
  • drivers/net/wireless/broadcom/brcm80211/brcmfmac

1 file changed

+1
-0
lines changed

drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb,
336336
bphy_err(drvr, "%s: failed to expand headroom\n",
337337
brcmf_ifname(ifp));
338338
atomic_inc(&drvr->bus_if->stats.pktcow_failed);
339+
dev_kfree_skb(skb);
339340
goto done;
340341
}
341342
}

0 commit comments

Comments
 (0)