diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/v4l2-core/videobuf-core.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/media/v4l2-core/videobuf-core.c b/drivers/media/v4l2-core/videobuf-core.c index fb5ee5dd8fe9..b91a266d0b7e 100644 --- a/drivers/media/v4l2-core/videobuf-core.c +++ b/drivers/media/v4l2-core/videobuf-core.c @@ -441,11 +441,6 @@ int videobuf_reqbufs(struct videobuf_queue *q, unsigned int size, count; int retval; - if (req->count < 1) { - dprintk(1, "reqbufs: count invalid (%d)\n", req->count); - return -EINVAL; - } - if (req->memory != V4L2_MEMORY_MMAP && req->memory != V4L2_MEMORY_USERPTR && req->memory != V4L2_MEMORY_OVERLAY) { @@ -471,6 +466,12 @@ int videobuf_reqbufs(struct videobuf_queue *q, goto done; } + if (req->count == 0) { + dprintk(1, "reqbufs: count invalid (%d)\n", req->count); + retval = __videobuf_free(q); + goto done; + } + count = req->count; if (count > VIDEO_MAX_FRAME) count = VIDEO_MAX_FRAME; |