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:	Sat, 3 Oct 2015 13:27:39 -0700
From:	Florian Fainelli <f.fainelli@...il.com>
To:	Neil Armstrong <narmstrong@...libre.com>,
	"David S. Miller" <davem@...emloft.net>,
	Guenter Roeck <linux@...ck-us.net>,
	vivien.didelot@...oirfairelinux.com, Andrew Lunn <andrew@...n.ch>,
	Fabian Frederick <fabf@...net.be>,
	Pavel Nakonechny <pavel.nakonechny@...tlab.ru>,
	Joe Perches <joe@...ches.com>, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org, nbd@...nwrt.org,
	sergei.shtylyov@...entembedded.com
Subject: Re: [PATCH v2 5/5] net: dsa: exit probe if no switch were found

Le 03/10/2015 07:26, Neil Armstrong a écrit :
> If no switch were found in dsa_setup_dst, return -ENODEV and
> exit the dsa_probe cleanly.
> 
> Tested-by: Andrew Lunn <andrew@...n.ch>
> Tested-by: Florian Fainelli <f.fainelli@...il.com>
> Signed-off-by: Neil Armstrong <narmstrong@...libre.com>
> ---

[snip]

>  static int dsa_probe(struct platform_device *pdev)
> @@ -926,9 +937,9 @@ static int dsa_probe(struct platform_device *pdev)
> 
>  	platform_set_drvdata(pdev, dst);
> 
> -	dsa_setup_dst(dst, dev, &pdev->dev, pd);
> -
> -	return 0;
> +	ret = dsa_setup_dst(dst, dev, &pdev->dev, pd);
> +	if (!ret)
> +		return 0;

That logic is a little weird, I would just go with something like this:

ret = dsa_setup_dst(ds, dev, &pdev->dev, pd);
if (ret)
	goto out;

return 0;
-- 
Florian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ