Skip to contentSkip to conversation

media: i2c: ov772x: fix memory leak in probe error path

PATCH New Biren Pandya 1 participant 1 message Jun 13

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: i2c: ov772x: fix memory leak in probe error path

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.

---
 drivers/media/i2c/ov772x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/ov772x.c +1 -1
index 062e102..2643a84 100644
@@ -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)
Signature · 1 line
2.50.1 (Apple Git-155)