From: Takashi Iwai Date: Mon, 1 Sep 2008 13:31:50 +0000 (+0200) Subject: ALSA: aaci - Fix NULL test at error path X-Git-Tag: v2.6.28-rc1~720^2~131 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=631e8ad428c45ba7ab34df91d1db6cb7bf74d526;p=linux-2.6-omap-h63xx.git ALSA: aaci - Fix NULL test at error path The original fix by Julien Brunel . 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 Signed-off-by: Jaroslav Kysela --- diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c index b0a47449496..89096e811a4 100644 --- a/sound/arm/aaci.c +++ b/sound/arm/aaci.c @@ -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; }