ALSA: Return proper error code at probe in sound/pcmcia/*
Signed-off-by: Takashi Iwai <tiwai@suse.de>
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c
index ec51569..7dea74b 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf.c
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c
@@ -121,13 +121,14 @@
pdacf = snd_pdacf_create(card);
if (!pdacf) {
snd_card_free(card);
- return -EIO;
+ return -ENOMEM;
}
- if (snd_device_new(card, SNDRV_DEV_LOWLEVEL, pdacf, &ops) < 0) {
+ err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, pdacf, &ops);
+ if (err < 0) {
kfree(pdacf);
snd_card_free(card);
- return -ENODEV;
+ return err;
}
snd_card_set_dev(card, &handle_to_dev(link));