diff options
author | Benjamin Gaignard <benjamin.gaignard@collabora.com> | 2023-11-09 17:29:18 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2023-11-23 11:55:19 +0100 |
commit | 5287f48952e0e03be919e04d25cb832207d9661a (patch) | |
tree | a814c61baaab5e7dd3c0267be43deac9a1739225 /drivers/media/common | |
parent | 6ea001f94ab571e5e7f8a187dad261710e58563b (diff) | |
download | lwn-5287f48952e0e03be919e04d25cb832207d9661a.tar.gz lwn-5287f48952e0e03be919e04d25cb832207d9661a.zip |
media: videobuf2: Remove duplicated index vs q->num_buffers check
vb2_get_buffer() already checks if the requested index is valid.
Stop duplicating this kind of check everywhere.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Reviewed-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/common')
-rw-r--r-- | drivers/media/common/videobuf2/videobuf2-v4l2.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/drivers/media/common/videobuf2/videobuf2-v4l2.c b/drivers/media/common/videobuf2/videobuf2-v4l2.c index 37f814a89ace..6ba13a95323c 100644 --- a/drivers/media/common/videobuf2/videobuf2-v4l2.c +++ b/drivers/media/common/videobuf2/videobuf2-v4l2.c @@ -817,10 +817,6 @@ int vb2_qbuf(struct vb2_queue *q, struct media_device *mdev, return -EBUSY; } - if (b->index >= q->num_buffers) { - dprintk(q, 1, "buffer index out of range\n"); - return -EINVAL; - } vb = vb2_get_buffer(q, b->index); if (!vb) { dprintk(q, 1, "can't find the requested buffer %u\n", b->index); @@ -892,10 +888,6 @@ int vb2_expbuf(struct vb2_queue *q, struct v4l2_exportbuffer *eb) { struct vb2_buffer *vb; - if (eb->index >= q->num_buffers) { - dprintk(q, 1, "buffer index out of range\n"); - return -EINVAL; - } vb = vb2_get_buffer(q, eb->index); if (!vb) { dprintk(q, 1, "can't find the requested buffer %u\n", eb->index); |