From: Mauro Carvalho Chehab <[email protected]>

commit eda94710d6502672c5ee7de198fa78a63ddfae3a upstream.

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 <[email protected]>
Signed-off-by: Paul Bolle <[email protected]>
---
0) I noticed the above warning when compiling v3.7.7-rc1. This warning
can be traced back to commit 896f38f582730a19eb49677105b4fe4c0270b82e
("[media] videobuf2-core: Replace BUG_ON and return an error at
vb2_queue_init()"), which shipped with v3.7. I didn't notice it with
earlier v3.7 stable releases, because v3.7.7-rc1 was the first release
for which I used a Fedora 18 config. (For previous releases I used a
Fedora 17 config.) Fedora 17 didn't enable the pwc driver.

1) Of course, fixing a warning isn't a very compelling reason to
backport a patch. But the commit explanation of this patch makes it
clear that this warning shouldn't have been ignored. So I suggest to add
this patch to stable-3.7.

2) Compile tested only. I do not have the required hardware to test
properly.

 drivers/media/usb/pwc/pwc-if.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/pwc/pwc-if.c b/drivers/media/usb/pwc/pwc-if.c
index e191572..5210239 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
        pdev->vb_queue.buf_struct_size = sizeof(struct pwc_frame_buf);
        pdev->vb_queue.ops = &pwc_vb_queue_ops;
        pdev->vb_queue.mem_ops = &vb2_vmalloc_memops;
-       vb2_queue_init(&pdev->vb_queue);
+       rc = vb2_queue_init(&pdev->vb_queue);
+       if (rc < 0) {
+               PWC_ERROR("Oops, could not initialize vb2 queue.\n");
+               goto err_free_mem;
+       }
 
        /* Init video_device structure */
        memcpy(&pdev->vdev, &pwc_template, sizeof(pwc_template));
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to