[PATCH] media: i2c: ov772x: fix memory leak in probe error path
From: Biren Pandya
Date: Sat Jun 13 2026 - 09:07:58 EST
If ov772x_parse_dt() fails, the probe function branches to
error_clk_put, which does not put the powerdown GPIO, leading
to a memory leak. Branch to error_gpio_put instead.
Signed-off-by: Biren Pandya <birenpandya@xxxxxxxxx>
---
drivers/media/i2c/ov772x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/i2c/ov772x.c b/drivers/media/i2c/ov772x.c
index 062e102..2643a84 100644
--- a/drivers/media/i2c/ov772x.c
+++ b/drivers/media/i2c/ov772x.c
@@ -1496,7 +1496,7 @@ static int ov772x_probe(struct i2c_client *client)
ret = ov772x_parse_dt(client, priv);
if (ret)
- goto error_clk_put;
+ goto error_gpio_put;
ret = ov772x_video_probe(priv);
if (ret < 0)
--
2.50.1 (Apple Git-155)