[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250311153059.aejqbclfcso6n3pk@uda0492258>
Date: Tue, 11 Mar 2025 21:00:59 +0530
From: "s-vadapalli@...com" <s-vadapalli@...com>
To: "Sverdlin, Alexander" <alexander.sverdlin@...mens.com>
CC: "s-vadapalli@...com" <s-vadapalli@...com>,
"netdev@...r.kernel.org"
<netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>,
"srk@...com" <srk@...com>
Subject: Re: [PATCH net v2] net: ethernet: ti: am65-cpsw: Fix NAPI
registration sequence
On Tue, Mar 11, 2025 at 03:25:36PM +0000, Sverdlin, Alexander wrote:
> Hi Siddharth!
>
> On Tue, 2025-03-11 at 20:48 +0530, s-vadapalli@...com wrote:
> > > > Registering the interrupts for TX or RX DMA Channels prior to registering
> > > > their respective NAPI callbacks can result in a NULL pointer dereference.
> > > > This is seen in practice as a random occurrence since it depends on the
> > > > randomness associated with the generation of traffic by Linux and the
> > > > reception of traffic from the wire.
> > > >
> > > > Fixes: 681eb2beb3ef ("net: ethernet: ti: am65-cpsw: ensure proper channel cleanup in error path")
> > > > Signed-off-by: Vignesh Raghavendra <vigneshr@...com>
> > > > Co-developed-by: Siddharth Vadapalli <s-vadapalli@...com>
> > > > Signed-off-by: Siddharth Vadapalli <s-vadapalli@...com>
> > >
> > > ...
> > >
> > >
> > > > @@ -2590,10 +2591,11 @@ static int am65_cpsw_nuss_init_rx_chns(struct am65_cpsw_common *common)
> > > > return 0;
> > > >
> > > > err_flow:
> > > > - for (--i; i >= 0 ; i--) {
> > > > + netif_napi_del(&flow->napi_rx);
> > >
> > > There are totally 3 "goto err_flow;" instances, so if k3_udma_glue_rx_flow_init() or
> > > k3_udma_glue_rx_get_irq() would fail on the first iteration, we would come here without
> > > a single call to netif_napi_add().
> >
> > The following should address this right?
>
> Looks good to me!
Thank you for the confirmation. I will post the v3 patch with the fix.
Regards,
Siddharth.
Powered by blists - more mailing lists