diff options
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); |