@@ -1280,10 +1280,10 @@ static int ov772x_video_probe(struct ov772x_priv *priv)
/* Check and show product ID and manufacturer ID. */
ret = regmap_read(priv->regmap, PID, &pid);
if (ret < 0)
- return ret;
+ goto done;
ret = regmap_read(priv->regmap, VER, &ver);
if (ret < 0)
- return ret;
+ goto done;
switch (VERSION(pid, ver)) {
case OV7720:
@@ -1301,10 +1301,10 @@ static int ov772x_video_probe(struct ov772x_priv *priv)
ret = regmap_read(priv->regmap, MIDH, &midh);
if (ret < 0)
- return ret;
+ goto done;
ret = regmap_read(priv->regmap, MIDL, &midl);
if (ret < 0)
- return ret;
+ goto done;
dev_info(&client->dev,
"%s Product ID %0x:%0x Manufacturer ID %x:%x\n",
If the clock priv->clk was not enabled in ov772x_power_on, it should not be disabled in any path. Conversely, if it was enabled in ov772x_power_on, it must be disabled in all error paths to ensure proper cleanup. Found by Linux Verification Center (linuxtesting.org) with Klever. Fixes: 762c28121d7c ("media: i2c: ov772x: Remove soc_camera dependencies") Signed-off-by: Vitalii Mordan <mordan@ispras.ru> --- drivers/media/i2c/ov772x.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)