From 990ddd211286de0b58e67483c758ce029715c97e Mon Sep 17 00:00:00 2001 From: "tom.leiming@gmail.com" Date: Sat, 18 Apr 2009 01:50:30 +0200 Subject: uvcvideo: fix uvc resume failed From: Ming Lei 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 Acked-by: Laurent Pinchart --- linux/drivers/media/video/uvc/uvc_video.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) --- linux/drivers/media/video/uvc/uvc_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. -- cgit v1.2.3