From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: "Wu, Xia" <xia.wu@intel.com>,
Linux Media Mailing List <linux-media@vger.kernel.org>
Cc: "mchehab@infradead.org" <mchehab@infradead.org>,
"horms+renesas@verge.net.au" <horms+renesas@verge.net.au>,
"laurent.pinchart@ideasonboard.com"
<laurent.pinchart@ideasonboard.com>,
Hans Verkuil <hverkuil@xs4all.nl>
Subject: Re: [PATCH] media: videobuf2-core: Fix one __qbuf_dmabuf() error path
Date: Wed, 9 Dec 2015 10:25:45 +0200 [thread overview]
Message-ID: <5667E589.3090108@linux.intel.com> (raw)
In-Reply-To: <05B4341E5F09BF4E97AEC15A9DBEC11A1193CA21@shsmsx102.ccr.corp.intel.com>
Hi Wu,
Wu, Xia wrote:
> Add dma_buf_put() to decrease refcount of the dmabuf in error path if DMABUF size is smaller than the requirement.
>
> Signed-off-by: wu xia <xia.wu@intel.com>
> ---
> drivers/media/v4l2-core/videobuf2-core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
> index 33bdd81..1f232e7 100644
> --- a/drivers/media/v4l2-core/videobuf2-core.c
> +++ b/drivers/media/v4l2-core/videobuf2-core.c
> @@ -1084,6 +1084,7 @@ static int __qbuf_dmabuf(struct vb2_buffer *vb, const void *pb)
> if (planes[plane].length < q->plane_sizes[plane]) {
> dprintk(1, "invalid dmabuf length for plane %d\n",
> plane);
> + dma_buf_put(dbuf);
> ret = -EINVAL;
> goto err;
> }
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Looks like the bug has been also in the original implementation, and the
code has been in a bit of flux since, yet the bug has remained...
I think it'd be nice to have this in stable kernels. Mauro, Hans, what
do you think?
--
Kind regards,
Sakari Ailus
sakari.ailus@linux.intel.com
next prev parent reply other threads:[~2015-12-09 8:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-09 7:26 [PATCH] media: videobuf2-core: Fix one __qbuf_dmabuf() error path Wu, Xia
2015-12-09 8:25 ` Sakari Ailus [this message]
2015-12-10 4:33 ` Wu, Xia
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=5667E589.3090108@linux.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=horms+renesas@verge.net.au \
--cc=hverkuil@xs4all.nl \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=xia.wu@intel.com \
/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