diff options
Diffstat (limited to 'drivers/char/agp/ati-agp.c')
-rw-r--r-- | drivers/char/agp/ati-agp.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/char/agp/ati-agp.c b/drivers/char/agp/ati-agp.c index e572ced9100a..109582ab3704 100644 --- a/drivers/char/agp/ati-agp.c +++ b/drivers/char/agp/ati-agp.c | |||
@@ -116,14 +116,12 @@ static int ati_create_gatt_pages(int nr_tables) | |||
116 | int retval = 0; | 116 | int retval = 0; |
117 | int i; | 117 | int i; |
118 | 118 | ||
119 | tables = kmalloc((nr_tables + 1) * sizeof(ati_page_map *), | 119 | tables = kzalloc((nr_tables + 1) * sizeof(ati_page_map *),GFP_KERNEL); |
120 | GFP_KERNEL); | ||
121 | if (tables == NULL) | 120 | if (tables == NULL) |
122 | return -ENOMEM; | 121 | return -ENOMEM; |
123 | 122 | ||
124 | memset(tables, 0, sizeof(ati_page_map *) * (nr_tables + 1)); | ||
125 | for (i = 0; i < nr_tables; i++) { | 123 | for (i = 0; i < nr_tables; i++) { |
126 | entry = kmalloc(sizeof(ati_page_map), GFP_KERNEL); | 124 | entry = kzalloc(sizeof(ati_page_map), GFP_KERNEL); |
127 | if (entry == NULL) { | 125 | if (entry == NULL) { |
128 | while (i>0) { | 126 | while (i>0) { |
129 | kfree (tables[i-1]); | 127 | kfree (tables[i-1]); |
@@ -134,7 +132,6 @@ static int ati_create_gatt_pages(int nr_tables) | |||
134 | retval = -ENOMEM; | 132 | retval = -ENOMEM; |
135 | break; | 133 | break; |
136 | } | 134 | } |
137 | memset(entry, 0, sizeof(ati_page_map)); | ||
138 | tables[i] = entry; | 135 | tables[i] = entry; |
139 | retval = ati_create_page_map(entry); | 136 | retval = ati_create_page_map(entry); |
140 | if (retval != 0) break; | 137 | if (retval != 0) break; |