lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 25 Sep 2020 11:43:55 +0200
From:   Bartosz Golaszewski <bgolaszewski@...libre.com>
To:     "Liu, Yongxin" <Yongxin.Liu@...driver.com>
Cc:     "David S . Miller" <davem@...emloft.net>,
        netdev <netdev@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Revert "net: ethernet: ixgbe: check the return value of ixgbe_mii_bus_init()"

On Fri, Sep 25, 2020 at 10:51 AM Liu, Yongxin <Yongxin.Liu@...driver.com> wrote:
>

[snip]

> > >                         true);
> > >
> > > -       err = ixgbe_mii_bus_init(hw);
> > > -       if (err)
> > > -               goto err_netdev;
> > > +       ixgbe_mii_bus_init(hw);
> > >
> > >         return 0;
> > >
> > > -err_netdev:
> > > -       unregister_netdev(netdev);
> > >  err_register:
> > >         ixgbe_release_hw_control(adapter);
> > >         ixgbe_clear_interrupt_scheme(adapter);
> > > --
> > > 2.14.4
> > >
> >
> > Then we should check if err == -ENODEV, not outright ignore all potential
> > errors, right?
> >
>
> Hm, it is weird to take -ENODEV as a no error.
> How about just return 0 instead of -ENODEV in the following function?
>

No, it's perfectly fine. -ENODEV means there's no device and this can
happen. The caller can then act accordingly - for example: ignore that
fact. We do it in several places[1].

Bartosz

[snip]

[1] https://elixir.bootlin.com/linux/latest/source/drivers/misc/eeprom/at24.c#L714

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ