Skip to content

Commit

Permalink
V4L/DVB (8884): em28xx-audio: fix memory leak
Browse files Browse the repository at this point in the history
Free allocated memory

Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Douglas Schilling Landgraf authored and Mauro Carvalho Chehab committed Sep 29, 2008
1 parent ff41efc commit ff9b3e4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/media/video/em28xx/em28xx-audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,14 @@ static int em28xx_init_audio_isoc(struct em28xx *dev)

memset(dev->adev->transfer_buffer[i], 0x80, sb_size);
urb = usb_alloc_urb(EM28XX_NUM_AUDIO_PACKETS, GFP_ATOMIC);
if (!urb)
if (!urb) {
em28xx_errdev("usb_alloc_urb failed!\n");
for (j = 0; j < i; j++) {
usb_free_urb(dev->adev->urb[j]);
kfree(dev->adev->transfer_buffer[j]);
}
return -ENOMEM;
}

urb->dev = dev->udev;
urb->context = dev;
Expand Down

0 comments on commit ff9b3e4

Please sign in to comment.