[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230315220822.6d8cf7ed@kernel.org>
Date: Wed, 15 Mar 2023 22:08:22 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Grant Grundler <grundler@...omium.org>
Cc: 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 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.
> +mdio_err:
> return ret;
> }
Powered by blists - more mailing lists