]> git.baikalelectronics.ru Git - kernel.git/commit
V4L/DVB (13153): uvcvideo: Fix uvc_alloc_urb_buffers()
authorMing Lei <tom.leiming@gmail.com>
Sun, 27 Sep 2009 08:30:34 +0000 (05:30 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 5 Dec 2009 20:40:36 +0000 (18:40 -0200)
commit10ddd5c008dbb56f7de012dec43344dceb3e87c1
tree4896ef2b17e9e7928f2b53e98fd39d8c59a95c6e
parent5703cd4518d0e38e7062213eb64ce9baf879d888
V4L/DVB (13153): uvcvideo: Fix uvc_alloc_urb_buffers()

This patch sets stream->urb_size as psize*npackets
before calling uvc_alloc_urb_buffers, which may fix
a possible failure of usb_buffer_free in case usb_buffer_alloc
returns NULL. The patch is based on the ideas below:

1,If usb_buffer_alloc can't allocate a buffer sucessfully,
uvc_free_urb_buffers will be called to free the allocated
buffers, and stream->urb_size is required to be passed to
usb_buffer_free;

2,uvc_free_urb_buffers can reset stream->urb_size.

This patch is against linux-v2.6.31-next-20090926.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/uvc/uvc_video.c