aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/pci_bind.c
diff options
context:
space:
mode:
authorBurman Yan <yan_952@hotmail.com>2006-12-19 15:56:11 -0500
committerLen Brown <len.brown@intel.com>2006-12-20 16:54:54 -0500
commit36bcbec7ce21e2e8b3143b11a05747330abeca70 (patch)
treed9ace4d83a5013dbb3cd599e7bc4358ce4cdb980 /drivers/acpi/pci_bind.c
parent5b7b4119553dd7cc0bc200c0d1b1598e158eec9a (diff)
ACPI: replace kmalloc+memset with kzalloc
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/pci_bind.c')
-rw-r--r--drivers/acpi/pci_bind.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/acpi/pci_bind.c b/drivers/acpi/pci_bind.c
index 70b440f3f262..55f57a61c55e 100644
--- a/drivers/acpi/pci_bind.c
+++ b/drivers/acpi/pci_bind.c
@@ -122,19 +122,17 @@ int acpi_pci_bind(struct acpi_device *device)
122 if (!device || !device->parent) 122 if (!device || !device->parent)
123 return -EINVAL; 123 return -EINVAL;
124 124
125 pathname = kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); 125 pathname = kzalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
126 if (!pathname) 126 if (!pathname)
127 return -ENOMEM; 127 return -ENOMEM;
128 memset(pathname, 0, ACPI_PATHNAME_MAX);
129 buffer.length = ACPI_PATHNAME_MAX; 128 buffer.length = ACPI_PATHNAME_MAX;
130 buffer.pointer = pathname; 129 buffer.pointer = pathname;
131 130
132 data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL); 131 data = kzalloc(sizeof(struct acpi_pci_data), GFP_KERNEL);
133 if (!data) { 132 if (!data) {
134 kfree(pathname); 133 kfree(pathname);
135 return -ENOMEM; 134 return -ENOMEM;
136 } 135 }
137 memset(data, 0, sizeof(struct acpi_pci_data));
138 136
139 acpi_get_name(device->handle, ACPI_FULL_PATHNAME, &buffer); 137 acpi_get_name(device->handle, ACPI_FULL_PATHNAME, &buffer);
140 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Binding PCI device [%s]...\n", 138 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Binding PCI device [%s]...\n",
@@ -281,10 +279,9 @@ int acpi_pci_unbind(struct acpi_device *device)
281 if (!device || !device->parent) 279 if (!device || !device->parent)
282 return -EINVAL; 280 return -EINVAL;
283 281
284 pathname = kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); 282 pathname = kzalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
285 if (!pathname) 283 if (!pathname)
286 return -ENOMEM; 284 return -ENOMEM;
287 memset(pathname, 0, ACPI_PATHNAME_MAX);
288 285
289 buffer.length = ACPI_PATHNAME_MAX; 286 buffer.length = ACPI_PATHNAME_MAX;
290 buffer.pointer = pathname; 287 buffer.pointer = pathname;
@@ -331,11 +328,9 @@ acpi_pci_bind_root(struct acpi_device *device,
331 char *pathname = NULL; 328 char *pathname = NULL;
332 struct acpi_buffer buffer = { 0, NULL }; 329 struct acpi_buffer buffer = { 0, NULL };
333 330
334 331 pathname = kzalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
335 pathname = kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
336 if (!pathname) 332 if (!pathname)
337 return -ENOMEM; 333 return -ENOMEM;
338 memset(pathname, 0, ACPI_PATHNAME_MAX);
339 334
340 buffer.length = ACPI_PATHNAME_MAX; 335 buffer.length = ACPI_PATHNAME_MAX;
341 buffer.pointer = pathname; 336 buffer.pointer = pathname;
@@ -345,12 +340,11 @@ acpi_pci_bind_root(struct acpi_device *device,
345 return -EINVAL; 340 return -EINVAL;
346 } 341 }
347 342
348 data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL); 343 data = kzalloc(sizeof(struct acpi_pci_data), GFP_KERNEL);
349 if (!data) { 344 if (!data) {
350 kfree(pathname); 345 kfree(pathname);
351 return -ENOMEM; 346 return -ENOMEM;
352 } 347 }
353 memset(data, 0, sizeof(struct acpi_pci_data));
354 348
355 data->id = *id; 349 data->id = *id;
356 data->bus = bus; 350 data->bus = bus;