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:   Mon, 22 Apr 2019 07:13:49 +0200
From:   Oleksij Rempel <o.rempel@...gutronix.de>
To:     David Miller <davem@...emloft.net>
Cc:     paul.burton@...s.com, ralf@...ux-mips.org, jhogan@...nel.org,
        robh+dt@...nel.org, jcliburn@...il.com, chris.snook@...il.com,
        mark.rutland@....com, kernel@...gutronix.de,
        linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org,
        devicetree@...r.kernel.org, john@...ozen.org, nbd@....name,
        netdev@...r.kernel.org
Subject: Re: [PATCH v2 3/3] net: ethernet: add ag71xx driver

Hi,

On Fri, Apr 19, 2019 at 02:35:19PM -0700, David Miller wrote:
> From: Oleksij Rempel <o.rempel@...gutronix.de>
> Date: Thu, 18 Apr 2019 07:26:20 +0200
> 
> > +static int ag71xx_remove(struct platform_device *pdev)
> > +{
> > +	struct net_device *ndev = platform_get_drvdata(pdev);
> > +	struct ag71xx *ag;
> > +
> > +	if (!ndev)
> > +		return 0;
> > +
> > +	ag = netdev_priv(ndev);
> > +	ag71xx_phy_disconnect(ag);
> > +	ag71xx_mdio_remove(ag);
> > +	unregister_netdev(ndev);
> > +	platform_set_drvdata(pdev, NULL);
> > +
> > +	return 0;
> > +}
> 
> You should unregister the netdev before you disconnect the PHY and remove
> the MDIO.

ok.

> Also you need to call free_netdev() afterwards otherwise you will leak it.

ndev is allocated with devm_alloc_etherdev(). Are you sure free_netdev()
should be used here?

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ