Skip to contentSkip to conversation

Patch "[media] vb2: Fix an off by one error in 'vb2_plane_vaddr'" has been added to the 3.18-stable tree

PATCH [email protected] 1 participant 1 message Jun 18, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

[media] vb2: Fix an off by one error in 'vb2_plane_vaddr'

to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
vb2-fix-an-off-by-one-error-in-vb2_plane_vaddr.patch
and it can be found in the queue-3.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 5ebb6dd36c9f5fb37b1077b393c254d70a14cb46 Mon Sep 17 00:00:00 2001

From: Christophe JAILLET <[email protected]>
Date: Fri, 28 Apr 2017 01:51:40 -0300
Subject: [media] vb2: Fix an off by one error in 'vb2_plane_vaddr'

From: Christophe JAILLET <[email protected]>

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")
---
 drivers/media/v4l2-core/videobuf2-core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/v4l2-core/videobuf2-core.c +1 -1
@@ -1120,7 +1120,7 @@ EXPORT_SYMBOL_GPL(vb2_create_bufs);
  */
 void *vb2_plane_vaddr(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, vaddr, vb->planes[plane_no].mem_priv);

Patches currently in stable-queue which might be from [email protected] are

queue-3.18/vb2-fix-an-off-by-one-error-in-vb2_plane_vaddr.patch queue-3.18/serial-efm32-fix-parity-management-in-efm32_uart_console_get_options.patch