diff options
author | Douglas Schilling Landgraf <dougsland@linuxtv.org> | 2008-09-04 10:20:20 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-09-29 07:26:01 -0400 |
commit | ff9b3e430b04e00dd2d29a26ae9438d7044a51db (patch) | |
tree | 96121c6714cb954c03c008527ed972595572f05c /drivers/media/video/em28xx/em28xx-audio.c | |
parent | ff41efcff635717ebe032437c4d6ee22badc9960 (diff) |
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/media/video/em28xx/em28xx-audio.c')
-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) | |||
161 | 161 | ||
162 | memset(dev->adev->transfer_buffer[i], 0x80, sb_size); | 162 | memset(dev->adev->transfer_buffer[i], 0x80, sb_size); |
163 | urb = usb_alloc_urb(EM28XX_NUM_AUDIO_PACKETS, GFP_ATOMIC); | 163 | urb = usb_alloc_urb(EM28XX_NUM_AUDIO_PACKETS, GFP_ATOMIC); |
164 | if (!urb) | 164 | if (!urb) { |
165 | em28xx_errdev("usb_alloc_urb failed!\n"); | ||
166 | for (j = 0; j < i; j++) { | ||
167 | usb_free_urb(dev->adev->urb[j]); | ||
168 | kfree(dev->adev->transfer_buffer[j]); | ||
169 | } | ||
165 | return -ENOMEM; | 170 | return -ENOMEM; |
171 | } | ||
166 | 172 | ||
167 | urb->dev = dev->udev; | 173 | urb->dev = dev->udev; |
168 | urb->context = dev; | 174 | urb->context = dev; |