On Fri, Jun 13, 2025 at 07:55:07AM -0700, Jakub Kicinski wrote:
> On Fri, 13 Jun 2025 07:47:11 -0700 Breno Leitao wrote:
> > >  static void nsim_queue_free(struct nsim_rq *rq)
> > >  {
> > > + struct net_device *dev = rq->napi.dev;
> > > +
> > >   hrtimer_cancel(&rq->napi_timer);
> > > + dev_dstats_rx_dropped_add(dev, rq->skb_queue.qlen);  
> > 
> > This is wrong and it will cause the kernel to crash in some cases, given
> > we can get here with dev == NULL, in the following path:
> 
> It's probably because NAPI wasn't registered yet in some paths.
> You can pass dev in from the callers, it always exists, and all 
> callers have it.

Right, that is a better approach.

I will update and send another version soon,
--breno

Reply via email to