aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/pci-sysfs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 29676fe4f23e..284e83a527f9 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -636,7 +636,7 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
636 goto err_rom; 636 goto err_rom;
637 } else { 637 } else {
638 retval = -ENOMEM; 638 retval = -ENOMEM;
639 goto err_bin_file; 639 goto err_resource_files;
640 } 640 }
641 } 641 }
642 /* add platform-specific attributes */ 642 /* add platform-specific attributes */
@@ -646,6 +646,8 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
646 646
647err_rom: 647err_rom:
648 kfree(rom_attr); 648 kfree(rom_attr);
649err_resource_files:
650 pci_remove_resource_files(pdev);
649err_bin_file: 651err_bin_file:
650 if (pdev->cfg_size < 4096) 652 if (pdev->cfg_size < 4096)
651 sysfs_remove_bin_file(&pdev->dev.kobj, &pci_config_attr); 653 sysfs_remove_bin_file(&pdev->dev.kobj, &pci_config_attr);