lkml.org 
[lkml]   [2020]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] staging: media: atomisp: Fix error path in lm3554_probe()
On Thu, Sep 03, 2020 at 07:24:51PM +0100, Alex Dewar wrote:
> +
> + ret = atomisp_register_i2c_module(&flash->sd, NULL, LED_FLASH);
> + if (!ret)
> + return 0;

Ugh!!! This is a a special case of the "success handling instead of
failure handling" anti-pattern where the last condition in the function
is different. I just fixed a bug caused by this on Wed.

https://www.spinics.net/lists/netdev/msg680226.html

But it doesn't cause any problems here so whatever...

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>

regards,
dan carpenter

\
 
 \ /
  Last update: 2020-09-04 08:36    [W:0.070 / U:1.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site