From: Jean-Francois Moine Date: Fri, 5 Sep 2008 15:49:54 +0000 (-0300) Subject: V4L/DVB (8926): gspca: Bad fix of leak memory (changeset 43d2ead315b1). X-Git-Tag: 2.1b_release~16354^2~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0d0548e67f0184704b7ecdf3c3ebf0e23c5af8c8;p=platform%2Fkernel%2Fkernel-mfld-blackbay.git V4L/DVB (8926): gspca: Bad fix of leak memory (changeset 43d2ead315b1). Signed-off-by: Jean-Francois Moine Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index ed8935d..ac95c55 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c @@ -459,8 +459,7 @@ static int create_urbs(struct gspca_dev *gspca_dev, urb = usb_alloc_urb(npkt, GFP_KERNEL); if (!urb) { err("usb_alloc_urb failed"); - for (i = 0; i < n; i++) - usb_free_urb(gspca_dev->urb[i]); + destroy_urbs(gspca_dev); return -ENOMEM; } urb->transfer_buffer = usb_buffer_alloc(gspca_dev->dev, @@ -470,8 +469,8 @@ static int create_urbs(struct gspca_dev *gspca_dev, if (urb->transfer_buffer == NULL) { usb_free_urb(urb); - destroy_urbs(gspca_dev); err("usb_buffer_urb failed"); + destroy_urbs(gspca_dev); return -ENOMEM; } gspca_dev->urb[n] = urb;