Skip to contentSkip to conversation

media: omap3isp: Add missed v4l2_ctrl_handler_free() for preview_init_entities()

PATCH In review Chuhong Yuan 3 participants 3 messages Jun 3, 2020 – Jun 4, 2020 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 media: omap3isp: Add missed v4l2_ctrl_handler_free() for preview_init_entities()

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]")

---
Changes in v2:
- Fix the typo.

 drivers/media/platform/omap3isp/isppreview.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/platform/omap3isp/isppreview.c +3 -1
index 4dbdf3180d10..607b7685c982 100644
@@ -2287,7 +2287,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);
 
@@ -2320,6 +2320,8 @@ static int preview_init_entities(struct isp_prev_device *prev)
 	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;
 }
 
Signature · 1 line
2.26.2
Reviewed-by on v2 1/1
#1 lore raw

Hi Chuhong,

(CC'ing Sakari Ailus)

Thank you for the patch.

Quoted 5 lines · Chuhong Yuan

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]")

There's an extra ']' at the end. Apart from that,

Sakari, could you take this patch ?

Quoted 30 lines

---
Changes in v2:
- Fix the typo.

 drivers/media/platform/omap3isp/isppreview.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/platform/omap3isp/isppreview.c +3 -1
index 4dbdf3180d10..607b7685c982 100644
@@ -2287,7 +2287,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);
 
@@ -2320,6 +2320,8 @@ static int preview_init_entities(struct isp_prev_device *prev)
 	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;
 }
 
Signature · 3 lines
Regards,

Laurent Pinchart
#2 lore raw
Quoted 11 lines · Laurent Pinchart

Hi Chuhong,

(CC'ing Sakari Ailus)

Thank you for the patch.

Quoted 4 lines · Chuhong Yuan

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

Quoted 7 lines
Quoted 1 line
Fixes de1135d44f4f ("[media] omap3isp: CCDC, preview engine and resizer]")

There's an extra ']' at the end. Apart from that,

Sakari, could you take this patch ?

Done; thank you!

Signature · 1 line
Sakari Ailus