diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2007-04-17 23:34:12 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-05-02 22:02:43 -0400 |
commit | 9890b12a4a65a7b3181dd963421740edf0e14d69 (patch) | |
tree | 2bdd7480a28ea6a31db49f768fa83333a61a5a16 /drivers | |
parent | c0affe9db42bf85f4a606b3262c35ec59a5d3788 (diff) |
PCI: Free resource files in error path of pci_create_sysfs_dev_files()
pci_create_sysfs_dev_files() should call pci_remove_resource_files() in
its error path, to match the call it makes to pci_create_resource_files().
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pci/pci-sysfs.c | 4 |
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 | ||
647 | err_rom: | 647 | err_rom: |
648 | kfree(rom_attr); | 648 | kfree(rom_attr); |
649 | err_resource_files: | ||
650 | pci_remove_resource_files(pdev); | ||
649 | err_bin_file: | 651 | err_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); |