summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDouglas Schilling Landgraf <dougsland@linuxtv.org>2008-09-04 11:20:20 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-09-29 08:26:01 -0300
commitff9b3e430b04e00dd2d29a26ae9438d7044a51db (patch)
tree96121c6714cb954c03c008527ed972595572f05c /drivers
parentff41efcff635717ebe032437c4d6ee22badc9960 (diff)
downloadblackbird-op-linux-ff9b3e430b04e00dd2d29a26ae9438d7044a51db.tar.gz
blackbird-op-linux-ff9b3e430b04e00dd2d29a26ae9438d7044a51db.zip
V4L/DVB (8884): em28xx-audio: fix memory leak
Free allocated memory Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/em28xx/em28xx-audio.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c
index 3c006103c1eb..08cb4e7711a5 100644
--- a/drivers/media/video/em28xx/em28xx-audio.c
+++ b/drivers/media/video/em28xx/em28xx-audio.c
@@ -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;
OpenPOWER on IntegriCloud