mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2025-11-29 22:30:49 +00:00
PCI: Release OF node in pci_scan_device()'s error path
In pci_scan_device(), if pci_setup_device() fails for any reason, the code
will not release device's of_node by calling pci_release_of_node(). Fix
that by calling the release function.
Fixes: 98d9f30c82 ("pci/of: Match PCI devices to OF nodes dynamically")
Link: https://lore.kernel.org/r/20210124232826.1879-1-dmitry.baryshkov@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
This commit is contained in:
parent
a38fd87484
commit
c99e755a4a
@ -2353,6 +2353,7 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn)
|
|||||||
pci_set_of_node(dev);
|
pci_set_of_node(dev);
|
||||||
|
|
||||||
if (pci_setup_device(dev)) {
|
if (pci_setup_device(dev)) {
|
||||||
|
pci_release_of_node(dev);
|
||||||
pci_bus_put(dev->bus);
|
pci_bus_put(dev->bus);
|
||||||
kfree(dev);
|
kfree(dev);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user