summaryrefslogtreecommitdiffstats
path: root/drivers/char/agp/sgi-agp.c
diff options
context:
space:
mode:
authorakpm@osdl.org <akpm@osdl.org>2007-01-02 14:44:31 -0800
committerDave Jones <davej@redhat.com>2007-01-02 23:37:31 -0500
commit7b37b064c294af350c462f77d7a9a44485a93684 (patch)
treeaf8969bd68634eadeb9932894a8b712e15c946ea /drivers/char/agp/sgi-agp.c
parent7f02d687b44aba0cfc393102ea1ccc78eadf8a04 (diff)
[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>
Diffstat (limited to 'drivers/char/agp/sgi-agp.c')
-rw-r--r--drivers/char/agp/sgi-agp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/char/agp/sgi-agp.c b/drivers/char/agp/sgi-agp.c
index d73be4c2db8..902648db7ef 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) {