提交 dc2b80c1 编写于 作者: D Douglas Schilling Landgraf 提交者: Mauro Carvalho Chehab

V4L/DVB (8886): ov511: fix memory leak

Free allocated memory

Cc: Luca Risolia <luca.risolia@studio.unibo.it>
Signed-off-by: NDouglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 beeb82be
...@@ -3591,7 +3591,7 @@ static int ...@@ -3591,7 +3591,7 @@ static int
ov51x_init_isoc(struct usb_ov511 *ov) ov51x_init_isoc(struct usb_ov511 *ov)
{ {
struct urb *urb; struct urb *urb;
int fx, err, n, size; int fx, err, n, i, size;
PDEBUG(3, "*** Initializing capture ***"); PDEBUG(3, "*** Initializing capture ***");
...@@ -3662,6 +3662,8 @@ ov51x_init_isoc(struct usb_ov511 *ov) ...@@ -3662,6 +3662,8 @@ ov51x_init_isoc(struct usb_ov511 *ov)
urb = usb_alloc_urb(FRAMES_PER_DESC, GFP_KERNEL); urb = usb_alloc_urb(FRAMES_PER_DESC, GFP_KERNEL);
if (!urb) { if (!urb) {
err("init isoc: usb_alloc_urb ret. NULL"); err("init isoc: usb_alloc_urb ret. NULL");
for (i = 0; i < n; i++)
usb_free_urb(ov->sbuf[i].urb);
return -ENOMEM; return -ENOMEM;
} }
ov->sbuf[n].urb = urb; ov->sbuf[n].urb = urb;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册