diff options
| author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2024-10-03 19:53:15 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-12-05 14:01:27 +0100 |
| commit | 30357297dc8c246b86c17a3f820227063cd04320 (patch) | |
| tree | 3ca3c5ec79d7e59e1aa09b1a84c7399b7f64c85a /drivers/media | |
| parent | e20117a105d4174c2daf4d6da17b92d757487e60 (diff) | |
| download | linux-30357297dc8c246b86c17a3f820227063cd04320.tar.gz linux-30357297dc8c246b86c17a3f820227063cd04320.tar.bz2 linux-30357297dc8c246b86c17a3f820227063cd04320.zip | |
media: i2c: vgxy61: Fix an error handling path in vgxy61_detect()
[ Upstream commit 0d5c92cde4d38825eeadf5b4e1534350f80a9924 ]
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: 9a6d7f2ba2b9 ("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>
Diffstat (limited to 'drivers/media')
| -rw-r--r-- | drivers/media/i2c/vgxy61.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/i2c/vgxy61.c b/drivers/media/i2c/vgxy61.c index 409d2d4ffb4b..d77468c8587b 100644 --- a/drivers/media/i2c/vgxy61.c +++ b/drivers/media/i2c/vgxy61.c @@ -1617,7 +1617,7 @@ static int vgxy61_detect(struct vgxy61_dev *sensor) ret = cci_read(sensor->regmap, VGXY61_REG_NVM, &st, NULL); if (ret < 0) - return st; + return ret; if (st != VGXY61_NVM_OK) dev_warn(&client->dev, "Bad nvm state got %u\n", (u8)st); |
