lkml.org 
[lkml]   [2017]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH 3.2 063/106] [media] vb2: fix plane index sanity check in vb2_plane_cookie()
3.2.93-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Zhaowei Yuan <zhaowei.yuan@samsung.com>

commit a9ae4692eda4b99f85757b15d60971ff78a0a0e2 upstream.

It's also invalid when plane_no is equal to vb->num_planes

Signed-off-by: Zhaowei Yuan <zhaowei.yuan@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
[bwh: Backported to 3.2: adjust filename, context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
drivers/media/video/videobuf2-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/media/video/videobuf2-core.c
+++ b/drivers/media/video/videobuf2-core.c
@@ -754,7 +754,7 @@ void *vb2_plane_cookie(struct vb2_buffer
{
struct vb2_queue *q = vb->vb2_queue;

- if (plane_no > vb->num_planes)
+ if (plane_no >= vb->num_planes)
return NULL;

return call_memop(q, plane_no, cookie, vb->planes[plane_no].mem_priv);
\
 
 \ /
  Last update: 2017-09-10 00:51    [W:0.430 / U:2.896 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site