Commit ff9b3e43 authored by Douglas Schilling Landgraf's avatar Douglas Schilling Landgraf Committed by Mauro Carvalho Chehab

V4L/DVB (8884): em28xx-audio: fix memory leak

Free allocated memory
Signed-off-by: default avatarDouglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent ff41efcf
...@@ -161,8 +161,14 @@ static int em28xx_init_audio_isoc(struct em28xx *dev) ...@@ -161,8 +161,14 @@ static int em28xx_init_audio_isoc(struct em28xx *dev)
memset(dev->adev->transfer_buffer[i], 0x80, sb_size); memset(dev->adev->transfer_buffer[i], 0x80, sb_size);
urb = usb_alloc_urb(EM28XX_NUM_AUDIO_PACKETS, GFP_ATOMIC); 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; return -ENOMEM;
}
urb->dev = dev->udev; urb->dev = dev->udev;
urb->context = dev; urb->context = dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment