* [PATCH] vim2m: Clean up file handle in open() error path.
@ 2016-12-07 17:23 Santosh Kumar Singh
2016-12-12 9:38 ` Laurent Pinchart
0 siblings, 1 reply; 3+ messages in thread
From: Santosh Kumar Singh @ 2016-12-07 17:23 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Hans Verkuil, Laurent Pinchart,
PJunghak Sung, Niklas Söderlund
Cc: linux-media, linux-kernel, Santosh Kumar Singh
Fix to avoid possible memory leak and exit file handle
in error paths.
Signed-off-by: Santosh Kumar Singh <kumar.san1093@gmail.com>
---
drivers/media/platform/vim2m.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/media/platform/vim2m.c b/drivers/media/platform/vim2m.c
index a98f679..9fd24b8 100644
--- a/drivers/media/platform/vim2m.c
+++ b/drivers/media/platform/vim2m.c
@@ -907,6 +907,7 @@ static int vim2m_open(struct file *file)
if (hdl->error) {
rc = hdl->error;
v4l2_ctrl_handler_free(hdl);
+ kfree(ctx);
goto open_unlock;
}
ctx->fh.ctrl_handler = hdl;
@@ -929,6 +930,7 @@ static int vim2m_open(struct file *file)
v4l2_ctrl_handler_free(hdl);
kfree(ctx);
+ v4l2_fh_exit(&ctx->fh);
goto open_unlock;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] vim2m: Clean up file handle in open() error path.
2016-12-07 17:23 Santosh Kumar Singh
@ 2016-12-12 9:38 ` Laurent Pinchart
0 siblings, 0 replies; 3+ messages in thread
From: Laurent Pinchart @ 2016-12-12 9:38 UTC (permalink / raw)
To: Santosh Kumar Singh
Cc: Mauro Carvalho Chehab, Hans Verkuil, PJunghak Sung,
Niklas Söderlund, linux-media, linux-kernel
Hi Santosh,
Thank you for the patch.
On Wednesday 07 Dec 2016 22:53:39 Santosh Kumar Singh wrote:
> Fix to avoid possible memory leak and exit file handle
> in error paths.
>
> Signed-off-by: Santosh Kumar Singh <kumar.san1093@gmail.com>
> ---
> drivers/media/platform/vim2m.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/media/platform/vim2m.c b/drivers/media/platform/vim2m.c
> index a98f679..9fd24b8 100644
> --- a/drivers/media/platform/vim2m.c
> +++ b/drivers/media/platform/vim2m.c
> @@ -907,6 +907,7 @@ static int vim2m_open(struct file *file)
> if (hdl->error) {
> rc = hdl->error;
> v4l2_ctrl_handler_free(hdl);
> + kfree(ctx);
> goto open_unlock;
> }
> ctx->fh.ctrl_handler = hdl;
> @@ -929,6 +930,7 @@ static int vim2m_open(struct file *file)
>
> v4l2_ctrl_handler_free(hdl);
> kfree(ctx);
> + v4l2_fh_exit(&ctx->fh);
Don't you notice something wrong in those last two lines ?
> goto open_unlock;
> }
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] vim2m: Clean up file handle in open() error path.
[not found] ` <CAJte=rNoyROJ=JQzUHRAMrREV9cHbWdpEXYthPv8hrGDhD943Q@mail.gmail.com>
@ 2016-12-16 12:34 ` Laurent Pinchart
0 siblings, 0 replies; 3+ messages in thread
From: Laurent Pinchart @ 2016-12-16 12:34 UTC (permalink / raw)
To: santosh kumar singh
Cc: Niklas Söderlund, Mauro Carvalho Chehab, Hans Verkuil,
linux-media, linux-kernel
On Friday 16 Dec 2016 14:31:15 santosh kumar singh wrote:
> Dear Mr. laurent,
>
> Can you please check the patch submitted by me.
No, because I haven't received it :-) You've sent it as an HTML message it it
thus got dropped by the mailing list. Please don't send HTML e-mails.
While at it, when submitting a new version of a patch, please indicate that in
the subject line. It should have been [PATCH v2]. Otherwise it's difficult for
us to figure out if the patch is a duplicate or a new version, or to find the
latest version.
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-12-16 12:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1481595874-2528-1-git-send-email-kumar.san1093@gmail.com>
[not found] ` <CAJte=rNoyROJ=JQzUHRAMrREV9cHbWdpEXYthPv8hrGDhD943Q@mail.gmail.com>
2016-12-16 12:34 ` [PATCH] vim2m: Clean up file handle in open() error path Laurent Pinchart
2016-12-07 17:23 Santosh Kumar Singh
2016-12-12 9:38 ` Laurent Pinchart
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).