From: Hans Verkuil <hans.verk...@cisco.com>

Since num_planes has been moved to vb2_queue, the __verify_planes_array()
function can now switch to a vb2_queue argument as well.

Signed-off-by: Hans Verkuil <hans.verk...@cisco.com>
---
 drivers/media/v4l2-core/videobuf2-core.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/media/v4l2-core/videobuf2-core.c 
b/drivers/media/v4l2-core/videobuf2-core.c
index febc23b..2e26e58 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -274,10 +274,8 @@ static void __vb2_queue_free(struct vb2_queue *q, unsigned 
int buffers)
  * __verify_planes_array() - verify that the planes array passed in struct
  * v4l2_buffer from userspace can be safely used
  */
-static int __verify_planes_array(struct vb2_buffer *vb, const struct 
v4l2_buffer *b)
+static int __verify_planes_array(struct vb2_queue *q, const struct v4l2_buffer 
*b)
 {
-       struct vb2_queue *q = vb->vb2_queue;
-
        /* Is memory for copying plane information present? */
        if (NULL == b->m.planes) {
                dprintk(1, "Multi-planar buffer passed but "
@@ -344,7 +342,7 @@ static int __fill_v4l2_buffer(struct vb2_buffer *vb, struct 
v4l2_buffer *b)
        b->reserved = vb->v4l2_buf.reserved;
 
        if (V4L2_TYPE_IS_MULTIPLANAR(q->type)) {
-               ret = __verify_planes_array(vb, b);
+               ret = __verify_planes_array(q, b);
                if (ret)
                        return ret;
 
@@ -831,7 +829,7 @@ static int __fill_vb2_buffer(struct vb2_buffer *vb, const 
struct v4l2_buffer *b,
                 * Verify that the userspace gave us a valid array for
                 * plane information.
                 */
-               ret = __verify_planes_array(vb, b);
+               ret = __verify_planes_array(q, b);
                if (ret)
                        return ret;
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to