aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/agp/sworks-agp.c
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2005-10-20 18:12:16 -0400
committerDave Jones <davej@redhat.com>2005-10-20 18:12:16 -0400
commit0ea27d9f2fb5b998063323bff47ab87891ced9e2 (patch)
tree1776e5eb03fb87184fc0e423da12acf5eb0540b7 /drivers/char/agp/sworks-agp.c
parent0ff541dafdcb9bc8933e7e4881e5924a408b5335 (diff)
[AGPGART] Replace kmalloc+memset's with kzalloc's
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/char/agp/sworks-agp.c')
-rw-r--r--drivers/char/agp/sworks-agp.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c
index 53968973f890..161d22b67fa3 100644
--- a/drivers/char/agp/sworks-agp.c
+++ b/drivers/char/agp/sworks-agp.c
@@ -100,19 +100,17 @@ static int serverworks_create_gatt_pages(int nr_tables)
100 int retval = 0; 100 int retval = 0;
101 int i; 101 int i;
102 102
103 tables = kmalloc((nr_tables + 1) * sizeof(struct serverworks_page_map *), 103 tables = kzalloc((nr_tables + 1) * sizeof(struct serverworks_page_map *),
104 GFP_KERNEL); 104 GFP_KERNEL);
105 if (tables == NULL) { 105 if (tables == NULL)
106 return -ENOMEM; 106 return -ENOMEM;
107 } 107
108 memset(tables, 0, sizeof(struct serverworks_page_map *) * (nr_tables + 1));
109 for (i = 0; i < nr_tables; i++) { 108 for (i = 0; i < nr_tables; i++) {
110 entry = kmalloc(sizeof(struct serverworks_page_map), GFP_KERNEL); 109 entry = kzalloc(sizeof(struct serverworks_page_map), GFP_KERNEL);
111 if (entry == NULL) { 110 if (entry == NULL) {
112 retval = -ENOMEM; 111 retval = -ENOMEM;
113 break; 112 break;
114 } 113 }
115 memset(entry, 0, sizeof(struct serverworks_page_map));
116 tables[i] = entry; 114 tables[i] = entry;
117 retval = serverworks_create_page_map(entry); 115 retval = serverworks_create_page_map(entry);
118 if (retval != 0) break; 116 if (retval != 0) break;