summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <m.chehab@samsung.com>2014-01-10 06:59:09 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-01-12 11:56:59 -0200
commit439c491c4c3e1d4f2be0a17d5789e0a19d85622c (patch)
treecbf75fff5d7956edf69b8cc19ec75d510974b4fa /drivers/media
parentd2849fa59d79dea7a6deeef13cc3efaafab3bf63 (diff)
downloadop-kernel-dev-439c491c4c3e1d4f2be0a17d5789e0a19d85622c.zip
op-kernel-dev-439c491c4c3e1d4f2be0a17d5789e0a19d85622c.tar.gz
[media] em28xx-audio: Fix error path
De-allocate memory and free sound if an error happens. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/usb/em28xx/em28xx-audio.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c
index 8e6f048..4ee3488 100644
--- a/drivers/media/usb/em28xx/em28xx-audio.c
+++ b/drivers/media/usb/em28xx/em28xx-audio.c
@@ -692,6 +692,7 @@ static int em28xx_audio_init(struct em28xx *dev)
if (intf->num_altsetting <= alt) {
em28xx_errdev("alt %d doesn't exist on interface %d\n",
dev->audio_ifnum, alt);
+ snd_card_free(card);
return -ENODEV;
}
@@ -707,6 +708,7 @@ static int em28xx_audio_init(struct em28xx *dev)
if (!ep) {
em28xx_errdev("Couldn't find an audio endpoint");
+ snd_card_free(card);
return -ENODEV;
}
@@ -759,6 +761,7 @@ static int em28xx_audio_init(struct em28xx *dev)
err = snd_card_register(card);
if (err < 0) {
+ em28xx_audio_free_urb(dev);
snd_card_free(card);
return err;
}
OpenPOWER on IntegriCloud