From: Amit Choudhary Date: Mon, 9 Oct 2006 14:03:52 +0000 (+0200) Subject: [ALSA] sound/isa/ad1816a/ad1816a.c: check kmalloc() return value X-Git-Tag: v2.6.19-rc3~4^2~11 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1e8a791c77bd35f88b678ce761928583efd8cd0;p=linux-2.6 [ALSA] sound/isa/ad1816a/ad1816a.c: check kmalloc() return value Check the return value of kmalloc() in function snd_card_ad1816a_pnp(), in file sound/isa/ad1816a/ad1816a.c. Signed-off-by: Amit Choudhary Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- diff --git a/sound/isa/ad1816a/ad1816a.c b/sound/isa/ad1816a/ad1816a.c index b33a5fb59e..5903450717 100644 --- a/sound/isa/ad1816a/ad1816a.c +++ b/sound/isa/ad1816a/ad1816a.c @@ -120,6 +120,8 @@ static int __devinit snd_card_ad1816a_pnp(int dev, struct snd_card_ad1816a *acar struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL); int err; + if (!cfg) + return -ENOMEM; acard->dev = pnp_request_card_device(card, id->devs[0].id, NULL); if (acard->dev == NULL) { kfree(cfg);