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:	Sat, 4 Sep 2010 07:45:11 +0200
From:	Wolfram Sang <w.sang@...gutronix.de>
To:	Dmitry Torokhov <dmitry.torokhov@...il.com>
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 02:45:40PM -0700, Dmitry Torokhov wrote:
> 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

Might be a mileage; I don't insist, though :)

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

So, the initialization to 0 could be removed, at least.

> Please explicitly assign error codes in error handling path.

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ