On 20/08/14 05:11, Zhaowei Yuan wrote: > It's also invalid that plane_no equals to vb->num_planes The patch looks good to me but I would make the summary line more specific, e.g. "vb2: fix plane index sanity check in vb2_plane_cookie()". I think this patch should be backported to the stable trees. > Signed-off-by: Zhaowei Yuan <zhaowei.yuan@xxxxxxxxxxx> > --- > drivers/media/v4l2-core/videobuf2-core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c > index c359006..1ae4e57 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); > -- > 1.7.9.5 -- Regards, Sylwester -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html