mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
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: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
d695e4ea86
commit
631e8ad428
1 changed files with 3 additions and 3 deletions
|
@ -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,
|
||||
THIS_MODULE, sizeof(struct aaci));
|
||||
if (card == NULL)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
return NULL;
|
||||
|
||||
card->private_free = aaci_free_card;
|
||||
|
||||
|
@ -1083,8 +1083,8 @@ static int __devinit aaci_probe(struct amba_device *dev, void *id)
|
|||
return ret;
|
||||
|
||||
aaci = aaci_init_card(dev);
|
||||
if (IS_ERR(aaci)) {
|
||||
ret = PTR_ERR(aaci);
|
||||
if (!aaci) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue