* [PATCH v2] media: i2c: max96717: clean up on error in max96717_subdev_init()
@ 2024-09-27 10:59 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2024-09-27 10:59 UTC (permalink / raw)
To: Julien Massot, Tommaso Merciai
Cc: Mauro Carvalho Chehab, Hans Verkuil, Sakari Ailus, linux-media,
linux-kernel, kernel-janitors
Call v4l2_ctrl_handler_free() to clean up from v4l2_ctrl_handler_init().
Fixes: 19b5e5511ca4 ("media: i2c: max96717: add test pattern ctrl")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Julien Massot <julien.massot@collabora.com>
---
v2: Use correct Fixes tag
drivers/media/i2c/max96717.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/media/i2c/max96717.c b/drivers/media/i2c/max96717.c
index 4e85b8eb1e77..9259d58ba734 100644
--- a/drivers/media/i2c/max96717.c
+++ b/drivers/media/i2c/max96717.c
@@ -697,8 +697,10 @@ static int max96717_subdev_init(struct max96717_priv *priv)
priv->pads[MAX96717_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
ret = media_entity_pads_init(&priv->sd.entity, 2, priv->pads);
- if (ret)
- return dev_err_probe(dev, ret, "Failed to init pads\n");
+ if (ret) {
+ dev_err_probe(dev, ret, "Failed to init pads\n");
+ goto err_free_ctrl;
+ }
ret = v4l2_subdev_init_finalize(&priv->sd);
if (ret) {
--
2.45.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2024-09-27 10:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-27 10:59 [PATCH v2] media: i2c: max96717: clean up on error in max96717_subdev_init() Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox