2016-12-01 04:53:15

by Shailendra Verma

[permalink] [raw]
Subject: [PATCH] Platform: vsp1: Clean up file handle in open() error path.

v4l2_fh_init is already done.So call the v4l2_fh_exit in error condition
before returing from the function.

Signed-off-by: Shailendra Verma <[email protected]>
---
drivers/media/platform/vsp1/vsp1_video.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c
index d351b9c..cc58163 100644
--- a/drivers/media/platform/vsp1/vsp1_video.c
+++ b/drivers/media/platform/vsp1/vsp1_video.c
@@ -1044,6 +1044,7 @@ static int vsp1_video_open(struct file *file)
ret = vsp1_device_get(video->vsp1);
if (ret < 0) {
v4l2_fh_del(vfh);
+ v4l2_fh_exit(vfh);
kfree(vfh);
}

--
1.7.9.5


2016-12-01 10:29:54

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [PATCH] Platform: vsp1: Clean up file handle in open() error path.

Hi Shailendra,

Thank you for the patch.

On Thursday 01 Dec 2016 10:20:18 Shailendra Verma wrote:
> v4l2_fh_init is already done.So call the v4l2_fh_exit in error condition
> before returing from the function.
>
> Signed-off-by: Shailendra Verma <[email protected]>

Reviewed-by: Laurent Pinchart <[email protected]>

and applied to my tree for v4.11.

> ---
> drivers/media/platform/vsp1/vsp1_video.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/platform/vsp1/vsp1_video.c
> b/drivers/media/platform/vsp1/vsp1_video.c index d351b9c..cc58163 100644
> --- a/drivers/media/platform/vsp1/vsp1_video.c
> +++ b/drivers/media/platform/vsp1/vsp1_video.c
> @@ -1044,6 +1044,7 @@ static int vsp1_video_open(struct file *file)
> ret = vsp1_device_get(video->vsp1);
> if (ret < 0) {
> v4l2_fh_del(vfh);
> + v4l2_fh_exit(vfh);
> kfree(vfh);
> }

--
Regards,

Laurent Pinchart