aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/pwc/pwc-if.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2012-10-27 13:26:25 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-10-28 05:38:32 -0400
commiteda94710d6502672c5ee7de198fa78a63ddfae3a (patch)
tree4be055893c2a45a388880542b7b3a0f76caa22d4 /drivers/media/usb/pwc/pwc-if.c
parent0dc6eb9ffcd350453eef91f790e81e042e183cfe (diff)
[media] pwc-if: must check vb2_queue_init() success
drivers/media/usb/pwc/pwc-if.c: In function 'usb_pwc_probe': drivers/media/usb/pwc/pwc-if.c:1003:16: warning: ignoring return value of 'vb2_queue_init', declared with attribute warn_unused_result [-Wunused-result] In the past, it used to have a logic there at queue init that would BUG() on errors. This logic got removed. Drivers are now required to explicitly handle the queue initialization errors, or very bad things may happen. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb/pwc/pwc-if.c')
-rw-r--r--drivers/media/usb/pwc/pwc-if.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/usb/pwc/pwc-if.c b/drivers/media/usb/pwc/pwc-if.c
index e191572970c4..5210239cbaee 100644
--- a/drivers/media/usb/pwc/pwc-if.c
+++ b/drivers/media/usb/pwc/pwc-if.c
@@ -1000,7 +1000,11 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
1000 pdev->vb_queue.buf_struct_size = sizeof(struct pwc_frame_buf); 1000 pdev->vb_queue.buf_struct_size = sizeof(struct pwc_frame_buf);
1001 pdev->vb_queue.ops = &pwc_vb_queue_ops; 1001 pdev->vb_queue.ops = &pwc_vb_queue_ops;
1002 pdev->vb_queue.mem_ops = &vb2_vmalloc_memops; 1002 pdev->vb_queue.mem_ops = &vb2_vmalloc_memops;
1003 vb2_queue_init(&pdev->vb_queue); 1003 rc = vb2_queue_init(&pdev->vb_queue);
1004 if (rc < 0) {
1005 PWC_ERROR("Oops, could not initialize vb2 queue.\n");
1006 goto err_free_mem;
1007 }
1004 1008
1005 /* Init video_device structure */ 1009 /* Init video_device structure */
1006 memcpy(&pdev->vdev, &pwc_template, sizeof(pwc_template)); 1010 memcpy(&pdev->vdev, &pwc_template, sizeof(pwc_template));