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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pm-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fix from Rafael Wysocki:
"Fix cpufreq reference counting in the DTPM (dynamic thermal and power
management) power capping framework (Lukasz Luba)"

* tag 'pm-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
powercap: DTPM: Fix missing cpufreq_cpu_put() calls

+13 -4
+13 -4
drivers/powercap/dtpm_cpu.c
··· 140 140 if (policy) { 141 141 for_each_cpu(dtpm_cpu->cpu, policy->related_cpus) 142 142 per_cpu(dtpm_per_cpu, dtpm_cpu->cpu) = NULL; 143 + 144 + cpufreq_cpu_put(policy); 143 145 } 144 146 145 147 kfree(dtpm_cpu); ··· 193 191 return 0; 194 192 195 193 pd = em_cpu_get(cpu); 196 - if (!pd || em_is_artificial(pd)) 197 - return -EINVAL; 194 + if (!pd || em_is_artificial(pd)) { 195 + ret = -EINVAL; 196 + goto release_policy; 197 + } 198 198 199 199 dtpm_cpu = kzalloc(sizeof(*dtpm_cpu), GFP_KERNEL); 200 - if (!dtpm_cpu) 201 - return -ENOMEM; 200 + if (!dtpm_cpu) { 201 + ret = -ENOMEM; 202 + goto release_policy; 203 + } 202 204 203 205 dtpm_init(&dtpm_cpu->dtpm, &dtpm_ops); 204 206 dtpm_cpu->cpu = cpu; ··· 222 216 if (ret) 223 217 goto out_dtpm_unregister; 224 218 219 + cpufreq_cpu_put(policy); 225 220 return 0; 226 221 227 222 out_dtpm_unregister: ··· 234 227 per_cpu(dtpm_per_cpu, cpu) = NULL; 235 228 kfree(dtpm_cpu); 236 229 230 + release_policy: 231 + cpufreq_cpu_put(policy); 237 232 return ret; 238 233 } 239 234