summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorZhaowei Yuan <zhaowei.yuan@samsung.com>2014-08-21 23:28:21 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-09-21 20:50:21 -0300
commita9ae4692eda4b99f85757b15d60971ff78a0a0e2 (patch)
treeb5f857083f955314babeec0d11ead1ba89bf79ad /drivers/media
parent983ed755641cfeac99716311f3d3b464d742f304 (diff)
[media] vb2: fix plane index sanity check in vb2_plane_cookie()
It's also invalid when plane_no is equal to vb->num_planes Signed-off-by: Zhaowei Yuan <zhaowei.yuan@samsung.com> Cc: stable@vger.kernel.org # for v3.7 and up Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/v4l2-core/videobuf2-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
index 7f70fd521ab1..c2126d874549 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -1130,7 +1130,7 @@ EXPORT_SYMBOL_GPL(vb2_plane_vaddr);
*/
void *vb2_plane_cookie(struct vb2_buffer *vb, unsigned int plane_no)
{
- if (plane_no > vb->num_planes || !vb->planes[plane_no].mem_priv)
+ if (plane_no >= vb->num_planes || !vb->planes[plane_no].mem_priv)
return NULL;
return call_ptr_memop(vb, cookie, vb->planes[plane_no].mem_priv);