[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y3dM0rG8JeYgE5pX@gmail.com>
Date: Fri, 18 Nov 2022 09:13:54 +0000
From: Martin Habets <habetsm.xilinx@...il.com>
To: Zhang Changzhong <zhangchangzhong@...wei.com>
Cc: Edward Cree <ecree.xilinx@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] sfc: fix potential memleak in
__ef100_hard_start_xmit()
On Thu, Nov 17, 2022 at 03:50:09PM +0800, Zhang Changzhong wrote:
> 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@...wei.com>
Acked-by: Martin Habets <habetsm.xilinx@...il.com>
> ---
> drivers/net/ethernet/sfc/ef100_netdev.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/sfc/ef100_netdev.c b/drivers/net/ethernet/sfc/ef100_netdev.c
> index 88fa295..ddcc325 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;
> }
>
> --
> 2.9.5
Powered by blists - more mailing lists