[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210517140244.615679366@linuxfoundation.org>
Date: Mon, 17 May 2021 16:01:47 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Leon Romanovsky <leonro@...dia.com>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.4 055/141] PCI: Release OF node in pci_scan_device()s error path
From: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
[ Upstream commit c99e755a4a4c165cad6effb39faffd0f3377c02d ]
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: 98d9f30c820d ("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@...aro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@...gle.com>
Reviewed-by: Leon Romanovsky <leonro@...dia.com>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/pci/probe.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 8fa13486f2f1..f28213b62527 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -2299,6 +2299,7 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn)
pci_set_of_node(dev);
if (pci_setup_device(dev)) {
+ pci_release_of_node(dev);
pci_bus_put(dev->bus);
kfree(dev);
return NULL;
--
2.30.2
Powered by blists - more mailing lists