]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86/amd: Fix refcount leak in amd_pmc_probe
authorMiaoqian Lin <linmq006@gmail.com>
Thu, 29 Dec 2022 07:25:33 +0000 (11:25 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:58:32 +0000 (11:58 +0100)
commitc3f1804e62c999c0f9a8d57f7b3030a74ecd6152
tree6820a6d2df4f89d60924e8e5dae7cd0c94fcbff6
parentecec5a174e3dff5ce56896fbad69ad8c57a9b0ea
platform/x86/amd: Fix refcount leak in amd_pmc_probe

[ Upstream commit ccb32e2be14271a60e9ba89c6d5660cc9998773c ]

pci_get_domain_bus_and_slot() takes reference, the caller should release
the reference by calling pci_dev_put() after use. Call pci_dev_put() in
the error path to fix this.

Fixes: 8635e6d3b84b ("platform/x86: amd-pmc: Add support for AMD Spill to DRAM STB feature")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20221229072534.1381432-1-linmq006@gmail.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/amd/pmc.c