vb2: Fix an off by one error in 'vb2_plane_vaddr' 73/175673/1
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 28 Apr 2017 04:51:40 +0000 (01:51 -0300)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 11 Apr 2018 09:33:45 +0000 (18:33 +0900)
commit51018b1e501a1ebda4eefc5791ed4e9a77bdfd5e
treef257ee8c7539fb8b9c919a5dd65b3a7b7f0a2718
parent6dc0b76aef05d9a88cd4eee955d570c17a18c512
vb2: Fix an off by one error in 'vb2_plane_vaddr'

commit 5ebb6dd36c9f5fb37b1077b393c254d70a14cb46 upstream.

We should ensure that 'plane_no' is '< vb->num_planes' as done in
'vb2_plane_cookie' just a few lines below.

Fixes: e23ccc0ad925 ("[media] v4l: add videobuf2 Video for Linux 2 driver framework")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[sw0312.kim: cherry-pick from linux-3.18.y]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I78542d0bb4c29c29a1c111cebed7ece2fc6d81cf
drivers/media/v4l2-core/videobuf2-core.c