Skip to content

Commit

Permalink
cpufreq: amd_freq_sensitivity: Add missing pci_dev_put()
Browse files Browse the repository at this point in the history
[ Upstream commit 91fda1f ]

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: 59a3b3a ("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>
  • Loading branch information
fenghusthu authored and gregkh committed Dec 31, 2022
1 parent 93e3c80 commit 19c202e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/cpufreq/amd_freq_sensitivity.c
Expand Up @@ -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))
Expand Down

0 comments on commit 19c202e

Please sign in to comment.