All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: David Miller <davem@davemloft.net>
Cc: paul.burton@mips.com, ralf@linux-mips.org, jhogan@kernel.org,
	robh+dt@kernel.org, jcliburn@gmail.com, chris.snook@gmail.com,
	mark.rutland@arm.com, kernel@pengutronix.de,
	linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, john@phrozen.org, nbd@nbd.name,
	netdev@vger.kernel.org
Subject: Re: [PATCH v2 3/3] net: ethernet: add ag71xx driver
Date: Mon, 22 Apr 2019 07:13:49 +0200	[thread overview]
Message-ID: <20190422051349.67awwpyat5sjbd7j@pengutronix.de> (raw)
In-Reply-To: <20190419.143519.94034508850689697.davem@davemloft.net>

Hi,

On Fri, Apr 19, 2019 at 02:35:19PM -0700, David Miller wrote:
> From: Oleksij Rempel <o.rempel@pengutronix.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 |

  reply	other threads:[~2019-04-22  5:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-18  5:26 [PATCH v2 0/3] MIPS: ath79: add ag71xx support Oleksij Rempel
2019-04-18  5:26 ` [PATCH v2 1/3] dt-bindings: net: add qca,ar71xx.txt documentation Oleksij Rempel
2019-04-18  5:26 ` [PATCH v2 2/3] MIPS: ath79: ar9331: add Ethernet nodes Oleksij Rempel
2019-04-18  5:26 ` [PATCH v2 3/3] net: ethernet: add ag71xx driver Oleksij Rempel
2019-04-19 21:35   ` David Miller
2019-04-22  5:13     ` Oleksij Rempel [this message]
2019-04-22  6:05   ` Rosen Penev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190422051349.67awwpyat5sjbd7j@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=chris.snook@gmail.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=jcliburn@gmail.com \
    --cc=jhogan@kernel.org \
    --cc=john@phrozen.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=paul.burton@mips.com \
    --cc=ralf@linux-mips.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.