From 631e8ad428c45ba7ab34df91d1db6cb7bf74d526 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 1 Sep 2008 15:31:50 +0200 Subject: 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 --- sound/arm/aaci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sound/arm/aaci.c') diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c index b0a474494966..89096e811a4b 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; } -- cgit v1.2.3