Subject: Re: [PATCH 1/1] net: dsa: Fix of kernel panic in case of missing PHY.

From: Sergei Shtylyov <[email-masked]>
Date: Tue, 09 Dec 2014 22:45:55 +0300

Hello.

On 12/09/2014 08:31 PM, Andrey Volkov wrote:

> Fix of kernel panic in case of missing PHY.

> Signed-off-by: Andrey Volkov <[email-masked]>
> ---
>   net/dsa/slave.c |   19 +++++++++++++++----
>   1 file changed, 15 insertions(+), 4 deletions(-)

> diff --git a/net/dsa/slave.c b/net/dsa/slave.c
> index 528380a..6f89caa 100644
> --- a/net/dsa/slave.c
> +++ b/net/dsa/slave.c
[...]
> @@ -555,12 +555,17 @@ static void dsa_slave_phy_setup(struct dsa_slave_priv *p,
>   	 */
>   	if (!p->phy) {
>   		p->phy = ds->slave_mii_bus->phy_map[p->port];
> -		phy_connect_direct(slave_dev, p->phy, dsa_slave_adjust_link,
> +		if(p->phy)

    Space is needed after *if*. Run your patches thru scripts/checkpatch.pl, 
it should detect such coding style issues.

> +			phy_connect_direct(slave_dev, p->phy, dsa_slave_adjust_link,
>   				   p->phy_interface);

    This continuation line should be realigned now, to start right under 
'slave_dev' on the previous line.

[...]

WBR, Sergei