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, 11 Feb 2012 21:47:55 +0000
From:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
To:	Laxman Dewangan <ldewangan@...dia.com>
Cc:	gregkh@...uxfoundation.org, lars@...afoo.de,
	linux-kernel@...r.kernel.org, linux-tegra@...r.kernel.org
Subject: Re: [PATCH V3 2/2] regmap: add regmap_bulk_write() for register write

On Fri, Feb 10, 2012 at 09:30:28PM +0530, Laxman Dewangan wrote:

> +		/* No formatting is require if val_byte is 1 */
> +		if (val_bytes == 1)
> +			wval = (void *)val;
> +		else {

Please don't combine branches with and without braces.

> +			wval = kmemdup(val, val_count * val_bytes, GFP_KERNEL);
> +			if (!wval) {
> +				mutex_unlock(&map->lock);
> +				dev_err(map->dev,
> +					"Error in memory allocation\n");
> +				return -ENOMEM;

As a style thing a goto error pattern is clearer for stuff like this -
there's so many branches that it's complex to keep track of the
unwinding.

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ