]> git.baikalelectronics.ru Git - kernel.git/commitdiff
cpufreq: amd_freq_sensitivity: Add missing pci_dev_put()
authorXiongfeng Wang <wangxiongfeng2@huawei.com>
Wed, 16 Nov 2022 11:33:39 +0000 (19:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:40:55 +0000 (11:40 +0100)
[ 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: 966fd7f2c4ac ("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>
drivers/cpufreq/amd_freq_sensitivity.c

index 5107cbe2d64dd2aeabb06d8b0e1d63e2c9dccb1a..72fd06fa0b59517fe38651893833a2c5b27e4738 100644 (file)
@@ -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))