All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: videobuf2-core: Fix one __qbuf_dmabuf() error path
@ 2015-12-09  7:26 Wu, Xia
  2015-12-09  8:25 ` Sakari Ailus
  0 siblings, 1 reply; 3+ messages in thread
From: Wu, Xia @ 2015-12-09  7:26 UTC (permalink / raw)
  To: Linux Media Mailing List
  Cc: sakari.ailus, mchehab, horms+renesas, laurent.pinchart

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;
 		}
--
1.7.9.5

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

end of thread, other threads:[~2015-12-10  4:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-09  7:26 [PATCH] media: videobuf2-core: Fix one __qbuf_dmabuf() error path Wu, Xia
2015-12-09  8:25 ` Sakari Ailus
2015-12-10  4:33   ` Wu, Xia

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.