[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241015170128.49714ba5@kernel.org>
Date: Tue, 15 Oct 2024 17:01:28 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Florian Fainelli <florian.fainelli@...adcom.com>
Cc: Wang Hai <wanghai38@...wei.com>, justin.chen@...adcom.com,
davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
horms@...nel.org, zhangxiaoxu5@...wei.com,
bcm-kernel-feedback-list@...adcom.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] net: bcmasp: fix potential memory leak in
bcmasp_xmit()
On Mon, 14 Oct 2024 10:14:59 -0700 Florian Fainelli wrote:
> On 10/14/24 07:59, Wang Hai wrote:
> > The bcmasp_xmit() returns NETDEV_TX_OK without freeing skb
> > in case of mapping fails, add dev_kfree_skb() to fix it.
> >
> > Fixes: 490cb412007d ("net: bcmasp: Add support for ASP2.0 Ethernet controller")
> > Signed-off-by: Wang Hai <wanghai38@...wei.com>
> > ---
> > drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c
> > index 82768b0e9026..9ea16ef4139d 100644
> > --- a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c
> > +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c
> > @@ -322,6 +322,7 @@ static netdev_tx_t bcmasp_xmit(struct sk_buff *skb, struct net_device *dev)
> > }
> > /* Rewind so we do not have a hole */
> > spb_index = intf->tx_spb_index;
> > + dev_kfree_skb(skb);
>
> Similar reasoning to the change proposed to bcmsysport.c, we already
> have a private counter tracking DMA mapping errors, therefore I would
> consider using dev_consume_skb_any() here.
.. but this one hasn't been pushed and I presume same treatment will
apply?
Powered by blists - more mailing lists