In mb86a20s_read_status_and_stats(), when mb86a20s_read_status() fails,
the function returns the value in variable rc without initializing it
first. Fix this by propagating the error code from variable status_nr.
This bug has been found using clang and -Wsometimes-uninitialized
warning flag.
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
if (status_nr < 0) {
dev_err(&state->i2c->dev,
"%s: Can't read frontend lock status\n", __func__);
+ rc = status_nr;
goto error;
}