Skip to content

Commit

Permalink
ALSA: aaci - Fix NULL test at error path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed Sep 4, 2008
1 parent d695e4e commit 631e8ad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sound/arm/aaci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 631e8ad

Please sign in to comment.