Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1332172

Re: [PATCH 2/2] net: dsa: remove phy_disconnect from error path

From Andrew Lunn <andrew@lunn.ch>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] net: dsa: remove phy_disconnect from error path
Date 2016-02-11 16:50 +0100
Message-ID <r11Fg-2lT-21@gated-at.bofh.it> (permalink)
References <r0WYW-7vk-13@gated-at.bofh.it> <r0WYW-7vk-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Feb 11, 2016 at 11:44:49AM +0100, Sascha Hauer wrote:
> 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>

Hi Sascha

The fix looks correct, since the phy should be bound to the device in
the following dsa_slave_phy_setup() call.

I'm not sure if Neil also fixed this...

Anyway,

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

     Andrew



> ---
>  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;
> -- 
> 2.7.0.rc3
> 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 2/2] net: dsa: remove phy_disconnect from error path Sascha Hauer <s.hauer@pengutronix.de> - 2016-02-11 11:50 +0100
  Re: [PATCH 2/2] net: dsa: remove phy_disconnect from error path Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-02-11 16:40 +0100
    Re: [PATCH 2/2] net: dsa: remove phy_disconnect from error path Neil Armstrong <narmstrong@baylibre.com> - 2016-02-15 10:00 +0100
  Re: [PATCH 2/2] net: dsa: remove phy_disconnect from error path Andrew Lunn <andrew@lunn.ch> - 2016-02-11 16:50 +0100
  Re: [PATCH 2/2] net: dsa: remove phy_disconnect from error path David Miller <davem@davemloft.net> - 2016-02-16 22:10 +0100

csiph-web