[PATCH v2] staging: media: atomisp: Fix error path in lm3554_probe()
dan.carpenter at oracle.com
Fri Sep 4 06:35:07 UTC 2020
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.
But it doesn't cause any problems here so whatever...
Reviewed-by: Dan Carpenter <dan.carpenter at oracle.com>
More information about the devel