Skip to content

Commit 3035729

Browse files
tititiou36gregkh
authored andcommitted
media: i2c: vgxy61: Fix an error handling path in vgxy61_detect()
[ Upstream commit 0d5c92c ] If cci_read() fails, 'st' is set to 0 in cci_read(), so we return success, instead of the expected error code. Fix it and return the expected error. Fixes: 9a6d7f2 ("media: i2c: st-vgxy61: Convert to CCI register access helpers") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent e20117a commit 3035729

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/media/i2c/vgxy61.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1617,7 +1617,7 @@ static int vgxy61_detect(struct vgxy61_dev *sensor)
16171617

16181618
ret = cci_read(sensor->regmap, VGXY61_REG_NVM, &st, NULL);
16191619
if (ret < 0)
1620-
return st;
1620+
return ret;
16211621
if (st != VGXY61_NVM_OK)
16221622
dev_warn(&client->dev, "Bad nvm state got %u\n", (u8)st);
16231623

0 commit comments

Comments
 (0)