From: akpm@osdl.org Date: Tue, 2 Jan 2007 22:44:31 +0000 (-0800) Subject: [AGPGART] drivers/char/agp/sgi-agp.c: check kmalloc() return value X-Git-Tag: v2.6.20-rc4~89^2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b37b064c294af350c462f77d7a9a44485a93684;p=linux-2.6 [AGPGART] drivers/char/agp/sgi-agp.c: check kmalloc() return value drivers/char/agp/sgi-agp.c: check kmalloc() return value Signed-off-by: Amit Choudhary Signed-off-by: Dave Jones Signed-off-by: Andrew Morton --- diff --git a/drivers/char/agp/sgi-agp.c b/drivers/char/agp/sgi-agp.c index d73be4c2db..902648db7e 100644 --- a/drivers/char/agp/sgi-agp.c +++ b/drivers/char/agp/sgi-agp.c @@ -281,10 +281,11 @@ static int __devinit agp_sgi_init(void) else return 0; - sgi_tioca_agp_bridges = - (struct agp_bridge_data **)kmalloc(tioca_gart_found * - sizeof(struct agp_bridge_data *), - GFP_KERNEL); + sgi_tioca_agp_bridges = kmalloc(tioca_gart_found * + sizeof(struct agp_bridge_data *), + GFP_KERNEL); + if (!sgi_tioca_agp_bridges) + return -ENOMEM; j = 0; list_for_each_entry(info, &tioca_list, ca_list) {