]> www.infradead.org Git - users/jedix/linux-maple.git/commit
PCI: endpoint: Destroy the EPC device in devm_pci_epc_destroy()
authorZijun Hu <quic_zijuhu@quicinc.com>
Tue, 10 Dec 2024 14:00:18 +0000 (22:00 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 12 Dec 2024 19:04:08 +0000 (13:04 -0600)
commitd4929755e4d02bd3de3ae5569dab69cb9502c54f
treef2d91f1812c0b1fb66cd79b30711e3520ae4d3ba
parent76850b54943ffd5037c97cc27794449ce05c31e9
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/20241210-pci-epc-core_fix-v3-1-4d86dd573e4b@quicinc.com
Fixes: 5e8cb4033807 ("PCI: endpoint: Add EP core layer to enable EP controller and EP functions")
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/endpoint/pci-epc-core.c