media: i2c: max96717: clean up on error in max96717_subdev_init()

[ Upstream commit d56786977ba11ed15b066495c1363889bcb1c3bb ]

Call v4l2_ctrl_handler_free() to clean up from v4l2_ctrl_handler_init().

Fixes: 19b5e5511c ("media: i2c: max96717: add test pattern ctrl")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Julien Massot <julien.massot@collabora.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Dan Carpenter
2024-09-27 13:59:10 +03:00
committed by Greg Kroah-Hartman
parent 30e42ac0bd
commit e20117a105
+4 -2
View File
@@ -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) {