Skip to content

Commit d492975

Browse files
zijun-hubjorn-helgaas
authored andcommitted
PCI: endpoint: Destroy the EPC device in devm_pci_epc_destroy()
The devm_pci_epc_destroy() comment says destroys the EPC device, but it does not actually do that since devres_destroy() does not call devm_pci_epc_release(), and it also can not fully undo what the API devm_pci_epc_create() does, so it is faulty. Fortunately, the faulty API has not been used by current kernel tree. Use devres_release() instead of devres_destroy() so the EPC device will be released. Link: https://lore.kernel.org/r/[email protected] Fixes: 5e8cb40 ("PCI: endpoint: Add EP core layer to enable EP controller and EP functions") Signed-off-by: Zijun Hu <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent 76850b5 commit d492975

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/endpoint/pci-epc-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ void devm_pci_epc_destroy(struct device *dev, struct pci_epc *epc)
942942
{
943943
int r;
944944

945-
r = devres_destroy(dev, devm_pci_epc_release, devm_pci_epc_match,
945+
r = devres_release(dev, devm_pci_epc_release, devm_pci_epc_match,
946946
epc);
947947
dev_WARN_ONCE(dev, r, "couldn't find PCI EPC resource\n");
948948
}

0 commit comments

Comments
 (0)