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] [day] [month] [year] [list]
Date:	Thu, 14 Nov 2013 12:58:13 +0000
From:	Mark Brown <broonie@...nel.org>
To:	Caizhiyong <caizhiyong@...ilicon.com>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"Wanglin (Albert)" <albert.wanglin@...ilicon.com>,
	Levente Kurusa <ilevex.linux@...il.com>,
	Levente Kurusa <levex@...ux.com>
Subject: Re: [PATCH] regmap: Fix 'ret' would return an uninitialized value

On Mon, Nov 11, 2013 at 11:35:52AM +0000, Caizhiyong wrote:

> +	int ret = 0;

With the if statement below you probably don't need to do this any more.

> +	if (num_regs <= 0) {
> +		WARN_ONCE(1, "Call regmap_register_patch with num_regs <= 0.");
> +		return 0;
> +	}

WARN_ONCE actually returns the result of the test so you should be able
to write this as:

	if (WARN_ONCE(num_regs <= 0))
		return 0;

which is slightly neater.

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