diff options
author | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-01-10 04:59:09 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-01-12 08:56:59 -0500 |
commit | 439c491c4c3e1d4f2be0a17d5789e0a19d85622c (patch) | |
tree | cbf75fff5d7956edf69b8cc19ec75d510974b4fa | |
parent | d2849fa59d79dea7a6deeef13cc3efaafab3bf63 (diff) |
[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>
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-audio.c | 3 |
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 8e6f04873422..4ee3488960e1 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) | |||
692 | if (intf->num_altsetting <= alt) { | 692 | if (intf->num_altsetting <= alt) { |
693 | em28xx_errdev("alt %d doesn't exist on interface %d\n", | 693 | em28xx_errdev("alt %d doesn't exist on interface %d\n", |
694 | dev->audio_ifnum, alt); | 694 | dev->audio_ifnum, alt); |
695 | snd_card_free(card); | ||
695 | return -ENODEV; | 696 | return -ENODEV; |
696 | } | 697 | } |
697 | 698 | ||
@@ -707,6 +708,7 @@ static int em28xx_audio_init(struct em28xx *dev) | |||
707 | 708 | ||
708 | if (!ep) { | 709 | if (!ep) { |
709 | em28xx_errdev("Couldn't find an audio endpoint"); | 710 | em28xx_errdev("Couldn't find an audio endpoint"); |
711 | snd_card_free(card); | ||
710 | return -ENODEV; | 712 | return -ENODEV; |
711 | } | 713 | } |
712 | 714 | ||
@@ -759,6 +761,7 @@ static int em28xx_audio_init(struct em28xx *dev) | |||
759 | 761 | ||
760 | err = snd_card_register(card); | 762 | err = snd_card_register(card); |
761 | if (err < 0) { | 763 | if (err < 0) { |
764 | em28xx_audio_free_urb(dev); | ||
762 | snd_card_free(card); | 765 | snd_card_free(card); |
763 | return err; | 766 | return err; |
764 | } | 767 | } |