aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/msi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/msi.c')
-rw-r--r--drivers/pci/msi.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 7a0fec6ce571..955ab7990c5b 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -545,9 +545,15 @@ static int populate_msi_sysfs(struct pci_dev *pdev)
545 return -ENOMEM; 545 return -ENOMEM;
546 list_for_each_entry(entry, &pdev->msi_list, list) { 546 list_for_each_entry(entry, &pdev->msi_list, list) {
547 char *name = kmalloc(20, GFP_KERNEL); 547 char *name = kmalloc(20, GFP_KERNEL);
548 if (!name)
549 goto error_attrs;
550
548 msi_dev_attr = kzalloc(sizeof(*msi_dev_attr), GFP_KERNEL); 551 msi_dev_attr = kzalloc(sizeof(*msi_dev_attr), GFP_KERNEL);
549 if (!msi_dev_attr) 552 if (!msi_dev_attr) {
553 kfree(name);
550 goto error_attrs; 554 goto error_attrs;
555 }
556
551 sprintf(name, "%d", entry->irq); 557 sprintf(name, "%d", entry->irq);
552 sysfs_attr_init(&msi_dev_attr->attr); 558 sysfs_attr_init(&msi_dev_attr->attr);
553 msi_dev_attr->attr.name = name; 559 msi_dev_attr->attr.name = name;
@@ -589,6 +595,7 @@ error_attrs:
589 ++count; 595 ++count;
590 msi_attr = msi_attrs[count]; 596 msi_attr = msi_attrs[count];
591 } 597 }
598 kfree(msi_attrs);
592 return ret; 599 return ret;
593} 600}
594 601
@@ -959,7 +966,6 @@ EXPORT_SYMBOL(pci_disable_msi);
959/** 966/**
960 * pci_msix_vec_count - return the number of device's MSI-X table entries 967 * pci_msix_vec_count - return the number of device's MSI-X table entries
961 * @dev: pointer to the pci_dev data structure of MSI-X device function 968 * @dev: pointer to the pci_dev data structure of MSI-X device function
962
963 * This function returns the number of device's MSI-X table entries and 969 * This function returns the number of device's MSI-X table entries and
964 * therefore the number of MSI-X vectors device is capable of sending. 970 * therefore the number of MSI-X vectors device is capable of sending.
965 * It returns a negative errno if the device is not capable of sending MSI-X 971 * It returns a negative errno if the device is not capable of sending MSI-X