]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI/portdrv: Fix potential resource leak
authorUwe Kleine-König <u.kleine-koenig@baylibre.com>
Tue, 2 Dec 2025 15:13:49 +0000 (16:13 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 13 Jan 2026 21:41:40 +0000 (15:41 -0600)
commit01464a3fdf91c041a381d93a1b6fefbdb819a46f
tree7983a633636139eda2226f56020c72a648491194
parent8f0b4cce4481fb22653697cced8d0d04027cb1e8
PCI/portdrv: Fix potential resource leak

pcie_port_probe_service() unconditionally calls get_device() (unless it
fails). So drop that reference also unconditionally as it's fine for a
PCIe driver to not have a remove callback.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Link: https://patch.msgid.link/e1c68c3b3f1af8427e98ca5e2c79f8bf0ebe2ce4.1764688034.git.u.kleine-koenig@baylibre.com
drivers/pci/pcie/portdrv.c