Skip to content

Commit 83a939f

Browse files
Uwe Kleine-Königbjorn-helgaas
authored andcommitted
PCI: exynos: Don't discard .remove() callback
With CONFIG_PCI_EXYNOS=y and exynos_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. This fixes the following warning by modpost: WARNING: modpost: drivers/pci/controller/dwc/pci-exynos: section mismatch in reference: exynos_pcie_driver+0x8 (section: .data) -> exynos_pcie_remove (section: .exit.text) (with ARCH=x86_64 W=1 allmodconfig). Fixes: 340cba6 ("pci: Add PCIe driver for Samsung Exynos") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Alim Akhtar <[email protected]> Cc: [email protected]
1 parent 8624ebc commit 83a939f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ static int exynos_pcie_probe(struct platform_device *pdev)
375375
return ret;
376376
}
377377

378-
static int __exit exynos_pcie_remove(struct platform_device *pdev)
378+
static int exynos_pcie_remove(struct platform_device *pdev)
379379
{
380380
struct exynos_pcie *ep = platform_get_drvdata(pdev);
381381

@@ -431,7 +431,7 @@ static const struct of_device_id exynos_pcie_of_match[] = {
431431

432432
static struct platform_driver exynos_pcie_driver = {
433433
.probe = exynos_pcie_probe,
434-
.remove = __exit_p(exynos_pcie_remove),
434+
.remove = exynos_pcie_remove,
435435
.driver = {
436436
.name = "exynos-pcie",
437437
.of_match_table = exynos_pcie_of_match,

0 commit comments

Comments
 (0)