[PATCH] driver: net: can: delete napi if register_candev fails

Marc Kleine-Budde mkl at pengutronix.de
Sun Oct 17 13:16:29 PDT 2021


On 17.10.2021 20:52:14, Dongliang Mu wrote:
> On Sun, Oct 17, 2021 at 8:36 PM Marc Kleine-Budde <mkl at pengutronix.de> wrote:
> >
> > On 13.10.2021 13:21:09, Dongliang Mu wrote:
> > > On Wed, Oct 13, 2021 at 12:04 PM Dongliang Mu <mudongliangabcd at gmail.com> wrote:
> > > >
> > > > If register_candev fails, xcan_probe does not clean the napi
> > > > created by netif_napi_add.
> > > >
> > >
> > > It seems the netif_napi_del operation is done in the free_candev
> > > (free_netdev precisely).
> > >
> > > list_for_each_entry_safe(p, n, &dev->napi_list, dev_list)
> > >           netif_napi_del(p);
> > >
> > > And list_add_rcu(&napi->dev_list, &dev->napi_list) is done in the
> > > netif_napi_add.
> > >
> > > Therefore, I suggest removing "netif_napi_del" operation in the
> > > xcan_remove to match probe and remove function.
> >
> > Sounds reasonable, can you create a patch for this.
> 
> I have submitted one patch - https://lkml.org/lkml/2021/10/17/181

Thanks for the patch.

Regards,
Marc

BTW: Do you know the new kernel.org mailing list archive available at
https://lore.kernel.org ?
You can reference a mail using its Message-ID, in you case it's:
https://lore.kernel.org/all/20211017125022.3100329-1-mudongliangabcd@gmail.com

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20211017/17bb327e/attachment.sig>


More information about the linux-arm-kernel mailing list