diff options
author | Ezequiel Garcia <elezegarcia@gmail.com> | 2012-09-26 07:30:34 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-10-06 12:25:21 -0300 |
commit | 5712661d643099bda44909cfd75560fcda72c387 (patch) | |
tree | b74b822a070b9de0008d790c9087ab8c9627d8b2 /drivers/media/usb/uvc/uvc_queue.c | |
parent | e0f6e4d6ff8d82ca6813f47d12f85224d7491d9e (diff) | |
download | blackbird-op-linux-5712661d643099bda44909cfd75560fcda72c387.tar.gz blackbird-op-linux-5712661d643099bda44909cfd75560fcda72c387.zip |
[media] uvc: Add return code check at vb2_queue_init()
This function returns an integer and it's mandatory
to check the return code.
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb/uvc/uvc_queue.c')
-rw-r--r-- | drivers/media/usb/uvc/uvc_queue.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/media/usb/uvc/uvc_queue.c b/drivers/media/usb/uvc/uvc_queue.c index 5577381b5bf0..18a91fae6bc1 100644 --- a/drivers/media/usb/uvc/uvc_queue.c +++ b/drivers/media/usb/uvc/uvc_queue.c @@ -122,21 +122,27 @@ static struct vb2_ops uvc_queue_qops = { .buf_finish = uvc_buffer_finish, }; -void uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type, +int uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type, int drop_corrupted) { + int ret; + queue->queue.type = type; queue->queue.io_modes = VB2_MMAP | VB2_USERPTR; queue->queue.drv_priv = queue; queue->queue.buf_struct_size = sizeof(struct uvc_buffer); queue->queue.ops = &uvc_queue_qops; queue->queue.mem_ops = &vb2_vmalloc_memops; - vb2_queue_init(&queue->queue); + ret = vb2_queue_init(&queue->queue); + if (ret) + return ret; mutex_init(&queue->mutex); spin_lock_init(&queue->irqlock); INIT_LIST_HEAD(&queue->irqqueue); queue->flags = drop_corrupted ? UVC_QUEUE_DROP_CORRUPTED : 0; + + return 0; } /* ----------------------------------------------------------------------------- |