Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cb1287a8 authored by Ming Lei's avatar Ming Lei Committed by Mauro Carvalho Chehab
Browse files

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: default avatarMing Lei <tom.leiming@gmail.com>
Acked-by: default avatarLaurent Pinchart <laurent.pinchart@skynet.be>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 091bf762
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -742,7 +742,7 @@ static int uvc_alloc_urb_buffers(struct uvc_video_device *video,


	/* Buffers are already allocated, bail out. */
	/* Buffers are already allocated, bail out. */
	if (video->urb_size)
	if (video->urb_size)
		return 0;
		return video->urb_size / psize;


	/* Compute the number of packets. Bulk endpoints might transfer UVC
	/* Compute the number of packets. Bulk endpoints might transfer UVC
	 * payloads accross multiple URBs.
	 * payloads accross multiple URBs.