summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2008-11-07 14:24:18 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-29 17:53:28 -0200
commit1f6340bd431921f9b6dc995973eb065d6c14f024 (patch)
tree36097e8ce3f0cf95729008bb1ffd51c5ce7c5f4b
parent886134e4be4e9ef585b0ecde5eebcaf37ee78f80 (diff)
downloadop-kernel-dev-1f6340bd431921f9b6dc995973eb065d6c14f024.zip
op-kernel-dev-1f6340bd431921f9b6dc995973eb065d6c14f024.tar.gz
V4L/DVB (9532): Properly handle error messages during alsa registering
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/em28xx/em28xx-audio.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c
index 7a8d49e..215ee78 100644
--- a/drivers/media/video/em28xx/em28xx-audio.c
+++ b/drivers/media/video/em28xx/em28xx-audio.c
@@ -428,7 +428,7 @@ static int em28xx_audio_init(struct em28xx *dev)
if (dev->has_audio_class) {
/* This device does not support the extension (in this case
- the device is expecting the snd-usb-audio module */
+ the device is expecting the snd-usb-audio module) */
return 0;
}
@@ -449,7 +449,12 @@ static int em28xx_audio_init(struct em28xx *dev)
}
spin_lock_init(&adev->slock);
- ret = snd_pcm_new(card, "Em28xx Audio", 0, 0, 1, &pcm);
+ err = snd_pcm_new(card, "Em28xx Audio", 0, 0, 1, &pcm);
+ if (err < 0) {
+ snd_card_free(card);
+ return err;
+ }
+
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_em28xx_pcm_capture);
pcm->info_flags = 0;
pcm->private_data = dev;
@@ -461,7 +466,7 @@ static int em28xx_audio_init(struct em28xx *dev)
err = snd_card_register(card);
if (err < 0) {
snd_card_free(card);
- return -ENOMEM;
+ return err;
}
adev->sndcard = card;
adev->udev = dev->udev;
OpenPOWER on IntegriCloud