public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: Vivien Didelot <vivien.didelot@savoirfairelinux.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
	Guenter Roeck <linux@roeck-us.net>
Subject: Re: [PATCH 2/2] net: dsa: remove phy_disconnect from error path
Date: Mon, 15 Feb 2016 09:52:50 +0100	[thread overview]
Message-ID: <56C191E2.90704@baylibre.com> (raw)
In-Reply-To: <8737szi7e0.fsf@ketchup.mtl.sfl>

On 02/11/2016 04:39 PM, Vivien Didelot wrote:
> Hi Sascha,
> 
> Sascha Hauer <s.hauer@pengutronix.de> writes:
> 
>> The phy has not been initialized, disconnecting it in the error
>> path results in a NULL pointer exception. Drop the phy_disconnect
>> from the error path.
>>
>> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
>> ---
>>  net/dsa/slave.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/net/dsa/slave.c b/net/dsa/slave.c
>> index 40b9ca7..91e3b2f 100644
>> --- a/net/dsa/slave.c
>> +++ b/net/dsa/slave.c
>> @@ -1194,7 +1194,6 @@ int dsa_slave_create(struct dsa_switch *ds, struct device *parent,
>>  	if (ret) {
>>  		netdev_err(master, "error %d registering interface %s\n",
>>  			   ret, slave_dev->name);
>> -		phy_disconnect(p->phy);
>>  		ds->ports[port] = NULL;
>>  		free_netdev(slave_dev);
>>  		return ret;
> 
> I'm adding Neil in the loop, since he did some work similar to this, if
> I'm not mistaken.
> 
> Thanks,
> -v
> 

He's right, the phy is not yet created in this error path.

Acked-by: Neil Armstrong <narmstrong@baylibre.com>

Thanks Vivien,
Neil

  reply	other threads:[~2016-02-15  8:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-11 10:44 [PATCH 1/2] net: dsa: mv88e6xxx: Add support for Marvell 88E6240 Sascha Hauer
2016-02-11 10:44 ` [PATCH 2/2] net: dsa: remove phy_disconnect from error path Sascha Hauer
2016-02-11 15:39   ` Vivien Didelot
2016-02-15  8:52     ` Neil Armstrong [this message]
2016-02-11 15:48   ` Andrew Lunn
2016-02-16 21:05   ` David Miller
2016-02-11 15:45 ` [PATCH 1/2] net: dsa: mv88e6xxx: Add support for Marvell 88E6240 Andrew Lunn
2016-02-16 21:05 ` David Miller

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=56C191E2.90704@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=andrew@lunn.ch \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=netdev@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=vivien.didelot@savoirfairelinux.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox