@@ -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;