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:	Fri, 3 Sep 2010 14:45:40 -0700
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Wolfram Sang <w.sang@...gutronix.de>
Cc:	Axel Lin <axel.lin@...il.com>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	Luotao Fu <l.fu@...gutronix.de>, linux-input@...r.kernel.org
Subject: Re: [PATCH 2/2] Input: stmpe-ts - return -ENOMEM if memory
 allocation fail

On Fri, Sep 03, 2010 at 11:35:24PM +0200, Wolfram Sang wrote:
> On Fri, Sep 03, 2010 at 09:32:13AM +0800, Axel Lin wrote:
> > Signed-off-by: Axel Lin <axel.lin@...il.com>
> 
> Basically correct. Should be simpler to just use
> 
> 	int ret = -ENOMEM;
> 
> though.
> 

No! I hate when people initialize error values like that, because it is
so easy to miss the case and end up with wrong value. If the original
version of the driver did not initialize it to 0 compiler would warn
the author and the error would not make it into the mainline to begin
with.

Please explicitly assign error codes in error handling path.

Thanks.


-- 
Dmitry
--
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