diff options
Diffstat (limited to 'drivers/char/agp/ati-agp.c')
-rw-r--r-- | drivers/char/agp/ati-agp.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/char/agp/ati-agp.c b/drivers/char/agp/ati-agp.c index 0b6e72642d6e..fbd415565463 100644 --- a/drivers/char/agp/ati-agp.c +++ b/drivers/char/agp/ati-agp.c | |||
@@ -118,14 +118,12 @@ static int ati_create_gatt_pages(int nr_tables) | |||
118 | int retval = 0; | 118 | int retval = 0; |
119 | int i; | 119 | int i; |
120 | 120 | ||
121 | tables = kmalloc((nr_tables + 1) * sizeof(ati_page_map *), | 121 | tables = kzalloc((nr_tables + 1) * sizeof(ati_page_map *),GFP_KERNEL); |
122 | GFP_KERNEL); | ||
123 | if (tables == NULL) | 122 | if (tables == NULL) |
124 | return -ENOMEM; | 123 | return -ENOMEM; |
125 | 124 | ||
126 | memset(tables, 0, sizeof(ati_page_map *) * (nr_tables + 1)); | ||
127 | for (i = 0; i < nr_tables; i++) { | 125 | for (i = 0; i < nr_tables; i++) { |
128 | entry = kmalloc(sizeof(ati_page_map), GFP_KERNEL); | 126 | entry = kzalloc(sizeof(ati_page_map), GFP_KERNEL); |
129 | if (entry == NULL) { | 127 | if (entry == NULL) { |
130 | while (i>0) { | 128 | while (i>0) { |
131 | kfree (tables[i-1]); | 129 | kfree (tables[i-1]); |
@@ -136,7 +134,6 @@ static int ati_create_gatt_pages(int nr_tables) | |||
136 | retval = -ENOMEM; | 134 | retval = -ENOMEM; |
137 | break; | 135 | break; |
138 | } | 136 | } |
139 | memset(entry, 0, sizeof(ati_page_map)); | ||
140 | tables[i] = entry; | 137 | tables[i] = entry; |
141 | retval = ati_create_page_map(entry); | 138 | retval = ati_create_page_map(entry); |
142 | if (retval != 0) break; | 139 | if (retval != 0) break; |
@@ -524,6 +521,7 @@ static struct pci_device_id agp_ati_pci_table[] = { | |||
524 | MODULE_DEVICE_TABLE(pci, agp_ati_pci_table); | 521 | MODULE_DEVICE_TABLE(pci, agp_ati_pci_table); |
525 | 522 | ||
526 | static struct pci_driver agp_ati_pci_driver = { | 523 | static struct pci_driver agp_ati_pci_driver = { |
524 | .owner = THIS_MODULE, | ||
527 | .name = "agpgart-ati", | 525 | .name = "agpgart-ati", |
528 | .id_table = agp_ati_pci_table, | 526 | .id_table = agp_ati_pci_table, |
529 | .probe = agp_ati_probe, | 527 | .probe = agp_ati_probe, |