Commit 631e8ad4 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

ALSA: aaci - Fix NULL test at error path

The original fix by Julien Brunel <brunel@diku.dk>.

aaci_init_card() returns a pointer with ERR_PTR(), but in aaci_init()
NULL is supposed at this error path.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@perex.cz>
parent d695e4ea
...@@ -999,7 +999,7 @@ static struct aaci * __devinit aaci_init_card(struct amba_device *dev) ...@@ -999,7 +999,7 @@ static struct aaci * __devinit aaci_init_card(struct amba_device *dev)
card = snd_card_new(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, card = snd_card_new(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1,
THIS_MODULE, sizeof(struct aaci)); THIS_MODULE, sizeof(struct aaci));
if (card == NULL) if (card == NULL)
return ERR_PTR(-ENOMEM); return NULL;
card->private_free = aaci_free_card; card->private_free = aaci_free_card;
...@@ -1083,8 +1083,8 @@ static int __devinit aaci_probe(struct amba_device *dev, void *id) ...@@ -1083,8 +1083,8 @@ static int __devinit aaci_probe(struct amba_device *dev, void *id)
return ret; return ret;
aaci = aaci_init_card(dev); aaci = aaci_init_card(dev);
if (IS_ERR(aaci)) { if (!aaci) {
ret = PTR_ERR(aaci); ret = -ENOMEM;
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment