diff options
author | Xiongfeng Wang <wangxiongfeng2@huawei.com> | 2022-11-16 14:33:39 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-14 12:15:18 +0300 |
commit | 0080461624e98ccff5bf9a43441a6862ff1ca4ed (patch) | |
tree | 74f2caf1eed5bc042a08913e49fac46d6ab151fc | |
parent | 9346517ed2c2767159060085185d6537fbfda619 (diff) | |
download | linux-0080461624e98ccff5bf9a43441a6862ff1ca4ed.tar.xz |
cpufreq: amd_freq_sensitivity: Add missing pci_dev_put()
[ Upstream commit 91fda1f88c0968f1491ab150bb01690525af150a ]
pci_get_device() will increase the reference count for the returned
pci_dev. We need to use pci_dev_put() to decrease the reference count
after using pci_get_device(). Let's add it.
Fixes: 59a3b3a8db16 ("cpufreq: AMD: Ignore the check for ProcFeedback in ST/CZ")
Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/cpufreq/amd_freq_sensitivity.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/cpufreq/amd_freq_sensitivity.c b/drivers/cpufreq/amd_freq_sensitivity.c index d0b10baf039a..151771129c7b 100644 --- a/drivers/cpufreq/amd_freq_sensitivity.c +++ b/drivers/cpufreq/amd_freq_sensitivity.c @@ -124,6 +124,8 @@ static int __init amd_freq_sensitivity_init(void) if (!pcidev) { if (!boot_cpu_has(X86_FEATURE_PROC_FEEDBACK)) return -ENODEV; + } else { + pci_dev_put(pcidev); } if (rdmsrl_safe(MSR_AMD64_FREQ_SENSITIVITY_ACTUAL, &val)) |