mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] media: i2c: ov772x: fix memory leak in probe error path
@ 2026-06-13 13:07 Biren Pandya
  0 siblings, 0 replies; only message in thread
From: Biren Pandya @ 2026-06-13 13:07 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: linux-media, linux-kernel, Biren Pandya

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@gmail.com>
---
 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)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-13 13:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-13 13:07 [PATCH] media: i2c: ov772x: fix memory leak in probe error path Biren Pandya

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®