linux/drivers/pci
Uwe Kleine-König efd8e6d19c PCI: exynos: Don't discard .remove() callback
commit 83a939f0fd upstream.

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: 340cba6092 ("pci: Add PCIe driver for Samsung Exynos")
Link: https://lore.kernel.org/r/20231001170254.2506508-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-11-28 17:07:11 +00:00
..
controller PCI: exynos: Don't discard .remove() callback 2023-11-28 17:07:11 +00:00
endpoint
hotplug PCI: pciehp: Use RMW accessors for changing LNKCTL 2023-09-13 09:42:46 +02:00
msi
pcie PCI/ASPM: Fix L1 substate handling in aspm_attr_store_common() 2023-11-28 17:07:11 +00:00
switch
access.c PCI: Add locking to RMW PCI Express Capability Register accessors 2023-09-13 09:42:46 +02:00
ats.c
bus.c
doe.c PCI/DOE: Fix destroy_work_on_stack() race 2023-09-13 09:42:45 +02:00
ecam.c
host-bridge.c
iov.c
irq.c
Kconfig
Makefile
mmap.c
of.c
p2pdma.c
pci-acpi.c PCI/sysfs: Protect driver's D3cold preference from user space 2023-11-28 17:07:08 +00:00
pci-bridge-emul.c
pci-bridge-emul.h
pci-driver.c
pci-label.c
pci-mid.c
pci-pf-stub.c
pci-stub.c
pci-sysfs.c PCI/sysfs: Protect driver's D3cold preference from user space 2023-11-28 17:07:08 +00:00
pci.c PCI: Use FIELD_GET() in Sapphire RX 5600 XT Pulse quirk 2023-11-28 17:07:00 +00:00
pci.h
probe.c PCI: Do error check on own line to split long "if" conditions 2023-11-28 17:07:00 +00:00
proc.c
quirks.c PCI: Disable ATS for specific Intel IPU E2000 devices 2023-11-28 17:07:00 +00:00
remove.c
rom.c
search.c
setup-bus.c
setup-irq.c
setup-res.c
slot.c
syscall.c
vc.c
vgaarb.c
vpd.c
xen-pcifront.c