Skip to content

Commit

Permalink
V4L/DVB (11575): uvcvideo: fix uvc resume failed
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ming Lei authored and Mauro Carvalho Chehab committed May 9, 2009
1 parent 091bf76 commit cb1287a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/video/uvc/uvc_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit cb1287a

Please sign in to comment.