diff options
author | tom.leiming@gmail.com <tom.leiming@gmail.com> | 2009-04-18 01:50:30 +0200 |
---|---|---|
committer | tom.leiming@gmail.com <tom.leiming@gmail.com> | 2009-04-18 01:50:30 +0200 |
commit | 990ddd211286de0b58e67483c758ce029715c97e (patch) | |
tree | 4885fc73bd061783c6628f95f964235ae78ec9e7 | |
parent | 8650091f79531c84de3ffa46f0b0d7655d610a1a (diff) | |
download | mediapointer-dvb-s2-990ddd211286de0b58e67483c758ce029715c97e.tar.gz mediapointer-dvb-s2-990ddd211286de0b58e67483c758ce029715c97e.tar.bz2 |
uvcvideo: fix uvc resume failed
From: Ming Lei <tom.leiming@gmail.com>
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.
Priority: normal
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@skynet.be>
---
linux/drivers/media/video/uvc/uvc_video.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
-rw-r--r-- | linux/drivers/media/video/uvc/uvc_video.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/linux/drivers/media/video/uvc/uvc_video.c b/linux/drivers/media/video/uvc/uvc_video.c index 82a9999b6..c5df33de9 100644 --- a/linux/drivers/media/video/uvc/uvc_video.c +++ b/linux/drivers/media/video/uvc/uvc_video.c @@ -746,7 +746,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. |