vb2: fix plane index sanity check in vb2_plane_cookie()
[pandora-kernel.git] / drivers / media / video / videobuf2-core.c
index 95a3f5e..912a74f 100644 (file)
@@ -754,7 +754,7 @@ void *vb2_plane_cookie(struct vb2_buffer *vb, unsigned int plane_no)
 {
        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);