diff options
author | Ma Ke <make24@iscas.ac.cn> | 2025-02-25 05:14:40 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-04-20 11:23:18 +0300 |
commit | f9208aec86226524ec1cb68a09ac70e974ea6536 (patch) | |
tree | 638e01865fa5bba0a1cc5f75f4b9448c42b54b96 /tools/perf/scripts/python/call-graph-from-sql.py | |
parent | 29332b168295fe6fdfaf3304740ede4c5aa37255 (diff) | |
download | linux-f9208aec86226524ec1cb68a09ac70e974ea6536.tar.xz |
PCI: Fix reference leak in pci_register_host_bridge()
commit 804443c1f27883926de94c849d91f5b7d7d696e9 upstream.
If device_register() fails, call put_device() to give up the reference to
avoid a memory leak, per the comment at device_register().
Found by code review.
Link: https://lore.kernel.org/r/20250225021440.3130264-1-make24@iscas.ac.cn
Fixes: 37d6a0a6f470 ("PCI: Add pci_register_host_bridge() interface")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
[bhelgaas: squash Dan Carpenter's double free fix from
https://lore.kernel.org/r/db806a6c-a91b-4e5a-a84b-6b7e01bdac85@stanley.mountain]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python/call-graph-from-sql.py')
0 files changed, 0 insertions, 0 deletions