linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] media: omap3isp: Add missed v4l2_ctrl_handler_free() for preview_init_entities()
@ 2020-06-03 16:41 Chuhong Yuan
  2020-06-04  9:33 ` Laurent Pinchart
  0 siblings, 1 reply; 3+ messages in thread
From: Chuhong Yuan @ 2020-06-03 16:41 UTC (permalink / raw)
  Cc: Laurent Pinchart, Mauro Carvalho Chehab, Ilkka Myllyperkio,
	Ivan T . Ivanov, Vimarsh Zutshi, Stanimir Varbanov, linux-media,
	linux-kernel, 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]")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
Changes in v2:
  - Fix the typo.

 drivers/media/platform/omap3isp/isppreview.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/omap3isp/isppreview.c b/drivers/media/platform/omap3isp/isppreview.c
index 4dbdf3180d10..607b7685c982 100644
--- a/drivers/media/platform/omap3isp/isppreview.c
+++ b/drivers/media/platform/omap3isp/isppreview.c
@@ -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;
 }
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] media: omap3isp: Add missed v4l2_ctrl_handler_free() for preview_init_entities()
  2020-06-03 16:41 [PATCH v2] media: omap3isp: Add missed v4l2_ctrl_handler_free() for preview_init_entities() Chuhong Yuan
@ 2020-06-04  9:33 ` Laurent Pinchart
  2020-06-04  9:50   ` Sakari Ailus
  0 siblings, 1 reply; 3+ messages in thread
From: Laurent Pinchart @ 2020-06-04  9:33 UTC (permalink / raw)
  To: Chuhong Yuan
  Cc: Mauro Carvalho Chehab, Ilkka Myllyperkio, Ivan T . Ivanov,
	Vimarsh Zutshi, Stanimir Varbanov, linux-media, linux-kernel,
	Sakari Ailus

Hi Chuhong,

(CC'ing Sakari Ailus)

Thank you for the patch.

On Thu, Jun 04, 2020 at 12:41:22AM +0800, Chuhong Yuan wrote:
> 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,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Sakari, could you take this patch ?

> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---
> Changes in v2:
>   - Fix the typo.
> 
>  drivers/media/platform/omap3isp/isppreview.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/omap3isp/isppreview.c b/drivers/media/platform/omap3isp/isppreview.c
> index 4dbdf3180d10..607b7685c982 100644
> --- a/drivers/media/platform/omap3isp/isppreview.c
> +++ b/drivers/media/platform/omap3isp/isppreview.c
> @@ -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;
>  }
>  

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] media: omap3isp: Add missed v4l2_ctrl_handler_free() for preview_init_entities()
  2020-06-04  9:33 ` Laurent Pinchart
@ 2020-06-04  9:50   ` Sakari Ailus
  0 siblings, 0 replies; 3+ messages in thread
From: Sakari Ailus @ 2020-06-04  9:50 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Chuhong Yuan, Mauro Carvalho Chehab, Ilkka Myllyperkio,
	Ivan T . Ivanov, Vimarsh Zutshi, Stanimir Varbanov, linux-media,
	linux-kernel

On Thu, Jun 04, 2020 at 12:33:21PM +0300, Laurent Pinchart wrote:
> Hi Chuhong,
> 
> (CC'ing Sakari Ailus)
> 
> Thank you for the patch.
> 
> On Thu, Jun 04, 2020 at 12:41:22AM +0800, Chuhong Yuan wrote:
> > 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,
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Sakari, could you take this patch ?

Done; thank you!

-- 
Sakari Ailus

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-04  9:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-03 16:41 [PATCH v2] media: omap3isp: Add missed v4l2_ctrl_handler_free() for preview_init_entities() Chuhong Yuan
2020-06-04  9:33 ` Laurent Pinchart
2020-06-04  9:50   ` Sakari Ailus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).