Re: [PATCH 2/2] Input: stmpe-ts - return -ENOMEM if memory allocation fail

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> 
> 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-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux