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:	Mon, 7 Sep 2009 10:07:57 +0100
From:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
To:	Andrey Panin <pazke@...trinvest.ru>
Cc:	Richard Purdie <rpurdie@...ys.net>, linux-kernel@...r.kernel.org,
	Samuel Ortiz <sameo@...ux.intel.com>
Subject: Re: [PATCH 2/2] leds: Add WM831x status LED driver

On Mon, Sep 07, 2009 at 11:25:07AM +0400, Andrey Panin wrote:
> On 248, 09 05, 2009 at 02:09:21PM +0100, Mark Brown wrote:

> > +	if (res == NULL) {
> > +		dev_err(&pdev->dev, "No I/O resource\n");
> > +		ret = -EINVAL;
> > +		goto err;

> Why not return -EINVAL right here ?

For consistency with the rest of the function which uses this style for
unwinding (though I see there's a cut'n'pasted return early on which
it'd be nice to clean up).

> > +err_led:
> > +	led_classdev_unregister(&drvdata->cdev);

> This line looks useless and possibly unsafe, led device was not registered.

True.

> Also this part of code can be removed if you move next line up.

I'd prefer to keep the unwinding at the end, it makes the initialisation
much easier to modify.
--
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