This is a note to let you know that I've just added the patch titled media: i2c: fix error check on max9286_read call to the 5.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: media-i2c-fix-error-check-on-max9286_read-call.patch and it can be found in the queue-5.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 2bd8f66acab4d8263d5457c8420a79b81a6a894f Author: Colin Ian King <colin.king@xxxxxxxxxxxxx> Date: Mon Jul 20 18:13:35 2020 +0200 media: i2c: fix error check on max9286_read call [ Upstream commit e5b95c8febd504659b60a7601fd43c0ae8e4f3c0 ] 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@xxxxxxxxxxxxx> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@xxxxxxxxxxxxxxxx> Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c index 47f280518fdb6..b364a3f604861 100644 --- a/drivers/media/i2c/max9286.c +++ b/drivers/media/i2c/max9286.c @@ -405,10 +405,11 @@ static int max9286_check_config_link(struct max9286_priv *priv, * to 5 milliseconds. */ for (i = 0; i < 10; i++) { - ret = max9286_read(priv, 0x49) & 0xf0; + ret = max9286_read(priv, 0x49); if (ret < 0) return -EIO; + ret &= 0xf0; if (ret == conflink_mask) break;