[media] uvcvideo: Fix race of open and suspend in error case
authorOliver Neukum <oliver@neukum.org>
Thu, 10 Jan 2013 10:04:55 +0000 (07:04 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 5 Feb 2013 16:32:21 +0000 (14:32 -0200)
commita82a45f65377b05fe8cd3167c7b0a70c508356b8
tree6b40a93218a8abef192e346c4052875f07c58a07
parent8c0d44e250735b09e255ce0483c47eb2f68d3fa7
[media] uvcvideo: Fix race of open and suspend in error case

Ming Lei reported:
IMO, there is a minor fault in the error handling path of
uvc_status_start() inside uvc_v4l2_open(), and the 'users' count should
have been decreased before usb_autopm_put_interface(). In theory, a [URB
resubmission] warning can be triggered when the device is opened just
between usb_autopm_put_interface() and atomic_dec(&stream->dev->users).
The fix is trivial.

Reported-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/usb/uvc/uvc_v4l2.c