diff options
author | Ming Lei <tom.leiming@gmail.com> | 2009-04-18 01:50:30 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-05-09 23:50:40 +0200 |
commit | cb1287a82281ab3ddb0768250a46603977075b91 (patch) | |
tree | 73d647ccfa6c29b5bc95f1574a80e6c3ba22a29c /drivers/media/video/uvc | |
parent | Linux 2.6.30-rc5 (diff) | |
download | linux-cb1287a82281ab3ddb0768250a46603977075b91.tar.xz linux-cb1287a82281ab3ddb0768250a46603977075b91.zip |
V4L/DVB (11575): uvcvideo: fix uvc resume failed
Now urb buffers is not freed before suspend, so uvc_alloc_urb_buffers should
return packet counts allocated originally during uvc resume, instead of zero.
This version uses round down to return packet counts on Linus' suggestions,
or else may lead to buffer destructed if packet size is changed before
calling uvc_alloc_urb_buffers() in this kind of case.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc')
-rw-r--r-- | drivers/media/video/uvc/uvc_video.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c index a95e17329c5b..6ce974d7362f 100644 --- a/drivers/media/video/uvc/uvc_video.c +++ b/drivers/media/video/uvc/uvc_video.c @@ -742,7 +742,7 @@ static int uvc_alloc_urb_buffers(struct uvc_video_device *video, /* Buffers are already allocated, bail out. */ if (video->urb_size) - return 0; + return video->urb_size / psize; /* Compute the number of packets. Bulk endpoints might transfer UVC * payloads accross multiple URBs. |