Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9890b12a authored by Michael Ellerman's avatar Michael Ellerman Committed by Greg Kroah-Hartman
Browse files

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: default avatarMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c0affe9d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -636,7 +636,7 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
				goto err_rom;
		} else {
			retval = -ENOMEM;
			goto err_bin_file;
			goto err_resource_files;
		}
	}
	/* add platform-specific attributes */
@@ -646,6 +646,8 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)

err_rom:
	kfree(rom_attr);
err_resource_files:
	pci_remove_resource_files(pdev);
err_bin_file:
	if (pdev->cfg_size < 4096)
		sysfs_remove_bin_file(&pdev->dev.kobj, &pci_config_attr);