From: Marek Szyprowski <m.szyprowski@samsung.com>
To: 'Dan Carpenter' <dan.carpenter@oracle.com>,
'Mauro Carvalho Chehab' <mchehab@infradead.org>
Cc: "'Hans Verkuil'" <hans.verkuil@cisco.com>,
"'Tomasz Moń'" <desowin@gmail.com>,
"'Guennadi Liakhovetski'" <g.liakhovetski@gmx.de>,
linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: RE: [patch] [media] mem2mem_testdev: unlock and return error code properly
Date: Fri, 17 Aug 2012 09:34:07 +0200 [thread overview]
Message-ID: <01eb01cd7c4a$b271a9b0$1754fd10$%szyprowski@samsung.com> (raw)
In-Reply-To: <20120814065856.GC4791@elgon.mountain>
Hi Dan,
On Tuesday, August 14, 2012 8:59 AM Dan Carpenter wrote:
> We recently added locking to this function, but there was an error path
> which accidentally returned holding a lock. Also we returned zero on
> failure on some paths instead of the error code.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Thanks for the patch!
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
> Applies to linux-next.
>
> diff --git a/drivers/media/video/mem2mem_testdev.c b/drivers/media/video/mem2mem_testdev.c
> index 0aa8c47..0b496f3 100644
> --- a/drivers/media/video/mem2mem_testdev.c
> +++ b/drivers/media/video/mem2mem_testdev.c
> @@ -911,10 +911,9 @@ static int m2mtest_open(struct file *file)
> v4l2_ctrl_new_custom(hdl, &m2mtest_ctrl_trans_time_msec, NULL);
> v4l2_ctrl_new_custom(hdl, &m2mtest_ctrl_trans_num_bufs, NULL);
> if (hdl->error) {
> - int err = hdl->error;
> -
> + rc = hdl->error;
> v4l2_ctrl_handler_free(hdl);
> - return err;
> + goto open_unlock;
> }
> ctx->fh.ctrl_handler = hdl;
> v4l2_ctrl_handler_setup(hdl);
> @@ -946,7 +945,7 @@ static int m2mtest_open(struct file *file)
>
> open_unlock:
> mutex_unlock(&dev->dev_mutex);
> - return 0;
> + return rc;
> }
>
> static int m2mtest_release(struct file *file)
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
prev parent reply other threads:[~2012-08-17 7:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-14 6:58 [patch] [media] mem2mem_testdev: unlock and return error code properly Dan Carpenter
2012-08-17 7:34 ` Marek Szyprowski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='01eb01cd7c4a$b271a9b0$1754fd10$%szyprowski@samsung.com' \
--to=m.szyprowski@samsung.com \
--cc=dan.carpenter@oracle.com \
--cc=desowin@gmail.com \
--cc=g.liakhovetski@gmx.de \
--cc=hans.verkuil@cisco.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox