Skip to content

Commit 200bddb

Browse files
Uwe Kleine-Königbjorn-helgaas
authored andcommitted
PCI: keystone: Don't discard .remove() callback
With CONFIG_PCIE_KEYSTONE=y and ks_pcie_remove() marked with __exit, the function is discarded from the driver. In this case a bound device can still get unbound, e.g via sysfs. Then no cleanup code is run resulting in resource leaks or worse. The right thing to do is do always have the remove callback available. Note that this driver cannot be compiled as a module, so ks_pcie_remove() was always discarded before this change and modpost couldn't warn about this issue. Furthermore the __ref annotation also prevents a warning. Fixes: 0c4ffcf ("PCI: keystone: Add TI Keystone PCIe driver") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Cc: [email protected]
1 parent 3064ef2 commit 200bddb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/pci/controller/dwc/pci-keystone.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,7 @@ static int __init ks_pcie_probe(struct platform_device *pdev)
13021302
return ret;
13031303
}
13041304

1305-
static int __exit ks_pcie_remove(struct platform_device *pdev)
1305+
static int ks_pcie_remove(struct platform_device *pdev)
13061306
{
13071307
struct keystone_pcie *ks_pcie = platform_get_drvdata(pdev);
13081308
struct device_link **link = ks_pcie->link;
@@ -1320,7 +1320,7 @@ static int __exit ks_pcie_remove(struct platform_device *pdev)
13201320

13211321
static struct platform_driver ks_pcie_driver __refdata = {
13221322
.probe = ks_pcie_probe,
1323-
.remove = __exit_p(ks_pcie_remove),
1323+
.remove = ks_pcie_remove,
13241324
.driver = {
13251325
.name = "keystone-pcie",
13261326
.of_match_table = ks_pcie_of_match,

0 commit comments

Comments
 (0)