diff options
author | Douglas Schilling Landgraf <dougsland@linuxtv.org> | 2008-09-04 16:20:20 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-09-29 13:26:01 +0200 |
commit | ff9b3e430b04e00dd2d29a26ae9438d7044a51db (patch) | |
tree | 96121c6714cb954c03c008527ed972595572f05c /drivers | |
parent | V4L/DVB (8883): w9968cf: Fix order of usb_alloc_urb validation (diff) | |
download | linux-ff9b3e430b04e00dd2d29a26ae9438d7044a51db.tar.xz 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.c | 8 |
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; |