media: i2c: fix error check on max9286_read call
authorColin Ian King <colin.king@canonical.com>
Mon, 20 Jul 2020 16:13:35 +0000 (18:13 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 1 Sep 2020 12:13:27 +0000 (14:13 +0200)
commite5b95c8febd504659b60a7601fd43c0ae8e4f3c0
tree09393c84dd06256563f1767e418fa8859e23fe39
parent4eb5928dbfff2f252d8bca7ec4c4ca0890da0927
media: i2c: fix error check on max9286_read call

Currently the error return from the call to max9286_read is masked
with 0xf0 so the following check for a negative error return is
never true.  Fix this by checking for an error first, then masking
the return value for subsequent conflink_mask checking.

Addresses-Coverity: ("Logically dead code")

Fixes: 66d8c9d2422d ("media: i2c: Add MAX9286 driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/i2c/max9286.c