[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 <amit2030@gmail.com>
Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
This commit is contained in:
akpm@osdl.org 2007-01-02 14:44:31 -08:00 committed by Dave Jones
parent 7f02d687b4
commit 7b37b064c2
1 changed files with 5 additions and 4 deletions

View File

@ -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) {