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] [day] [month] [year] [list]
Message-ID: <CANEJEGv0fSa9ZqArTDJcSwUpjKrOS=502Uz6C6LRh3gptfTs9g@mail.gmail.com>
Date:   Fri, 17 Mar 2023 10:58:55 -0700
From:   Grant Grundler <grundler@...omium.org>
To:     Jakub Kicinski <kuba@...nel.org>
Cc:     Grant Grundler <grundler@...omium.org>,
        Oleksij Rempel <linux@...pel-privat.de>,
        Pavel Skripkin <paskripkin@...il.com>,
        Lukas Wunner <lukas@...ner.de>,
        Eizan Miyamoto <eizan@...omium.org>,
        netdev <netdev@...r.kernel.org>,
        "David S . Miller" <davem@...emloft.net>,
        LKML <linux-kernel@...r.kernel.org>,
        Anton Lundin <glance@....umu.se>
Subject: Re: [PATCHv4 net] net: asix: fix modprobe "sysfs: cannot create
 duplicate filename"

On Wed, Mar 15, 2023 at 10:08 PM Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Mon, 13 Mar 2023 22:54:10 -0700 Grant Grundler wrote:
> > @@ -690,6 +704,7 @@ static int ax88772_init_phy(struct usbnet *dev)
> >       priv->phydev = mdiobus_get_phy(priv->mdio, priv->phy_addr);
> >       if (!priv->phydev) {
> >               netdev_err(dev->net, "Could not find PHY\n");
> > +             ax88772_mdio_unregister(priv);
>
> this line needs to go now..
>
> >               return -ENODEV;
>
> .. since if we return error here ..
>
> >       }
> >
> > @@ -896,16 +911,23 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
> >
> >       ret = ax88772_init_mdio(dev);
> >       if (ret)
> > -             return ret;
> > +             goto mdio_err;
> >
> >       ret = ax88772_phylink_setup(dev);
> >       if (ret)
> > -             return ret;
> > +             goto phylink_err;
> >
> >       ret = ax88772_init_phy(dev);
>
> .. it will pop out here ..
>
> >       if (ret)
> > -             phylink_destroy(priv->phylink);
> > +             goto initphy_err;
> >
> > +     return 0;
> > +
> > +initphy_err:
> > +     phylink_destroy(priv->phylink);
> > +phylink_err:
> > +     ax88772_mdio_unregister(priv);
>
> .. and then call ax88772_mdio_unregister() a second time.

Doh! Yes - good catch. Let me fix that.

cheers,
grant

>
> > +mdio_err:
> >       return ret;
> >  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ