diff options
author | Burman Yan <yan_952@hotmail.com> | 2006-12-19 15:56:11 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-12-20 16:54:54 -0500 |
commit | 36bcbec7ce21e2e8b3143b11a05747330abeca70 (patch) | |
tree | d9ace4d83a5013dbb3cd599e7bc4358ce4cdb980 /drivers/acpi/pci_link.c | |
parent | 5b7b4119553dd7cc0bc200c0d1b1598e158eec9a (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_link.c')
-rw-r--r-- | drivers/acpi/pci_link.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index 812d733fe816..481e633bbf41 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c | |||
@@ -307,11 +307,10 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) | |||
307 | if (!link || !irq) | 307 | if (!link || !irq) |
308 | return -EINVAL; | 308 | return -EINVAL; |
309 | 309 | ||
310 | resource = kmalloc(sizeof(*resource) + 1, irqs_disabled() ? GFP_ATOMIC: GFP_KERNEL); | 310 | resource = kzalloc(sizeof(*resource) + 1, irqs_disabled() ? GFP_ATOMIC: GFP_KERNEL); |
311 | if (!resource) | 311 | if (!resource) |
312 | return -ENOMEM; | 312 | return -ENOMEM; |
313 | 313 | ||
314 | memset(resource, 0, sizeof(*resource) + 1); | ||
315 | buffer.length = sizeof(*resource) + 1; | 314 | buffer.length = sizeof(*resource) + 1; |
316 | buffer.pointer = resource; | 315 | buffer.pointer = resource; |
317 | 316 | ||
@@ -718,10 +717,9 @@ static int acpi_pci_link_add(struct acpi_device *device) | |||
718 | if (!device) | 717 | if (!device) |
719 | return -EINVAL; | 718 | return -EINVAL; |
720 | 719 | ||
721 | link = kmalloc(sizeof(struct acpi_pci_link), GFP_KERNEL); | 720 | link = kzalloc(sizeof(struct acpi_pci_link), GFP_KERNEL); |
722 | if (!link) | 721 | if (!link) |
723 | return -ENOMEM; | 722 | return -ENOMEM; |
724 | memset(link, 0, sizeof(struct acpi_pci_link)); | ||
725 | 723 | ||
726 | link->device = device; | 724 | link->device = device; |
727 | strcpy(acpi_device_name(device), ACPI_PCI_LINK_DEVICE_NAME); | 725 | strcpy(acpi_device_name(device), ACPI_PCI_LINK_DEVICE_NAME); |