summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorZhaowei Yuan <zhaowei.yuan@samsung.com>2014-08-20 15:39:30 +0800
committerChanho Park <chanho61.park@samsung.com>2014-11-18 12:00:41 +0900
commit6655878923d628529d354a9a3a64b27ede2f9774 (patch)
tree36a26531e4753c2af8326a63fd1ad5d6a1018c2b /drivers/media
parent4321f6f188170e3461fe23064e5eb54a261af7f1 (diff)
downloadlinux-3.10-6655878923d628529d354a9a3a64b27ede2f9774.tar.gz
linux-3.10-6655878923d628529d354a9a3a64b27ede2f9774.tar.bz2
linux-3.10-6655878923d628529d354a9a3a64b27ede2f9774.zip
vb2: fix plane index sanity check in vb2_plane_cookie()
It's also invalid that plane_no equals to vb->num_planes Change-Id: Icb11d9d5712f79d67ba2132e78fd4e90f91fef6a Signed-off-by: Zhaowei Yuan <zhaowei.yuan@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 2e85fb4e031..9c2c1856489 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -1128,7 +1128,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);