summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/sfc
diff options
context:
space:
mode:
authorZhang Changzhong <zhangchangzhong@huawei.com>2022-11-17 10:50:09 +0300
committerPaolo Abeni <pabeni@redhat.com>2022-11-22 13:28:16 +0300
commitaad98abd5cb8133507f22654f56bcb443aaa2d89 (patch)
treee9e4697a46b3ed4fda0fa8fa6d60fd748f369ac3 /drivers/net/ethernet/sfc
parente541dd7763fc34aec2f93f652a396cc2e7b92d8d (diff)
downloadlinux-aad98abd5cb8133507f22654f56bcb443aaa2d89.tar.xz
sfc: fix potential memleak in __ef100_hard_start_xmit()
The __ef100_hard_start_xmit() returns NETDEV_TX_OK without freeing skb in error handling case, add dev_kfree_skb_any() to fix it. Fixes: 51b35a454efd ("sfc: skeleton EF100 PF driver") Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com> Acked-by: Martin Habets <habetsm.xilinx@gmail.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Link: https://lore.kernel.org/r/1668671409-10909-1-git-send-email-zhangchangzhong@huawei.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/ethernet/sfc')
-rw-r--r--drivers/net/ethernet/sfc/ef100_netdev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/ef100_netdev.c b/drivers/net/ethernet/sfc/ef100_netdev.c
index 88fa29572e23..ddcc325ed570 100644
--- a/drivers/net/ethernet/sfc/ef100_netdev.c
+++ b/drivers/net/ethernet/sfc/ef100_netdev.c
@@ -218,6 +218,7 @@ netdev_tx_t __ef100_hard_start_xmit(struct sk_buff *skb,
skb->len, skb->data_len, channel->channel);
if (!efx->n_channels || !efx->n_tx_channels || !channel) {
netif_stop_queue(net_dev);
+ dev_kfree_skb_any(skb);
goto err;
}