Re: [net-next v16 04/12] net: mtip: The L2 switch driver for imx287

Lukasz Majewski
2025-07-27T08:08:33Z

[-- Attachment #1: Type: text/plain, Size: 954 bytes --]

Hi Jakub,

> On Sat, 26 Jul 2025 22:13:23 +0200 Lukasz Majewski wrote:
> > > > + ret = register_netdev(fep->ndev[i]);
> > > > + if (ret) {
> > > > + dev_err(&fep->ndev[i]->dev,
> > > > + "%s: ndev %s register err:
> > > > %d\n", __func__,
> > > > + fep->ndev[i]->name, ret);
> > > > + break;
> > > > + }
> > >
> > > Error handling in case of register_netdev() still buggy, AFAICT.
> > >
> >
> > I've added the code to set fep->ndev[i] = NULL to
> > mtip_ndev_cleanup(). IMHO this is the correct place to add it.
>
> If register_netdev() fails you will try to unregister it and hit
> a BUG_ON().

Ach.... right. Thanks for explanation.

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Johanna Denk,
Tabea Lutz HRB 165235 Munich, Office: Kirchenstr.5, D-82194
Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]