[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210226232229.1076199-1-colin.king@canonical.com>
Date: Fri, 26 Feb 2021 23:22:29 +0000
From: Colin King <colin.king@...onical.com>
To: Sakari Ailus <sakari.ailus@...ux.intel.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Arnd Bergmann <arnd@...db.de>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
linux-media@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] media: i2c: adp1653: fix error handling from a call to adp1653_get_fault
From: Colin Ian King <colin.king@...onical.com>
The error check on rval from the call to adp1653_get_fault currently
returns if rval is non-zero. This appears to be incorrect as the
following if statement checks for various bit settings in rval so
clearly rval is expected to be non-zero at that point. Coverity
flagged the if statement up as deadcode. Fix this so the error
return path only occurs when rval is negative.
Addresses-Coverity: ("Logically dead code")
Fixes: 287980e49ffc ("remove lots of IS_ERR_VALUE abuses")
Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
drivers/media/i2c/adp1653.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/i2c/adp1653.c b/drivers/media/i2c/adp1653.c
index 522a0b10e415..1a4878385394 100644
--- a/drivers/media/i2c/adp1653.c
+++ b/drivers/media/i2c/adp1653.c
@@ -170,7 +170,7 @@ static int adp1653_set_ctrl(struct v4l2_ctrl *ctrl)
int rval;
rval = adp1653_get_fault(flash);
- if (rval)
+ if (rval < 0)
return rval;
if ((rval & (ADP1653_REG_FAULT_FLT_SCP |
ADP1653_REG_FAULT_FLT_OT |
--
2.30.0
Powered by blists - more mailing lists