media: omap3isp: Add missed v4l2_ctrl_handler_free() for preview_init_entities()
authorChuhong Yuan <hslester96@gmail.com>
Wed, 3 Jun 2020 16:41:22 +0000 (18:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Aug 2020 07:48:07 +0000 (09:48 +0200)
[ Upstream commit dc7690a73017e1236202022e26a6aa133f239c8c ]

preview_init_entities() does not call v4l2_ctrl_handler_free() when
it fails.
Add the missed function to fix it.

Fixes: de1135d44f4f ("[media] omap3isp: CCDC, preview engine and resizer")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.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>
drivers/media/platform/omap3isp/isppreview.c

index e981eb2330f1813b9a00f6867872630a2180da1b..ac005ae4d21b4718035863ad1a152ea458aa5dd0 100644 (file)
@@ -2290,7 +2290,7 @@ static int preview_init_entities(struct isp_prev_device *prev)
        me->ops = &preview_media_ops;
        ret = media_entity_pads_init(me, PREV_PADS_NUM, pads);
        if (ret < 0)
-               return ret;
+               goto error_handler_free;
 
        preview_init_formats(sd, NULL);
 
@@ -2323,6 +2323,8 @@ error_video_out:
        omap3isp_video_cleanup(&prev->video_in);
 error_video_in:
        media_entity_cleanup(&prev->subdev.entity);
+error_handler_free:
+       v4l2_ctrl_handler_free(&prev->ctrls);
        return ret;
 }