Files
linux/drivers/pci
Ma Ke 6176fa57dd PCI: Fix reference leak in pci_alloc_child_bus()
commit 1f2768b6a3ee77a295106e3a5d68458064923ede upstream.

If device_register(&child->dev) fails, call put_device() to explicitly
release child->dev, per the comment at device_register().

Found by code review.

Link: https://lore.kernel.org/r/20250202062357.872971-1-make24@iscas.ac.cn
Fixes: 4f535093cf ("PCI: Put pci_dev in device tree as early as possible")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-04-25 10:45:36 +02:00
..
2021-06-16 17:20:40 -05:00
2025-04-10 14:37:28 +02:00
2024-08-11 12:47:15 +02:00
2021-09-28 13:43:17 -05:00
2023-08-25 08:15:08 -05:00
2020-08-05 18:23:14 -05:00
2023-08-24 13:27:47 -05:00