Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cpufreq: amd_freq_sensitivity: Add missing pci_dev_put()

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>

authored by

Xiongfeng Wang and committed by
Rafael J. Wysocki
91fda1f8 5c510548

+2
+2
drivers/cpufreq/amd_freq_sensitivity.c
··· 125 125 if (!pcidev) { 126 126 if (!boot_cpu_has(X86_FEATURE_PROC_FEEDBACK)) 127 127 return -ENODEV; 128 + } else { 129 + pci_dev_put(pcidev); 128 130 } 129 131 130 132 if (rdmsrl_safe(MSR_AMD64_FREQ_SENSITIVITY_ACTUAL, &val))