cpufreq/amd-pstate: Add missing NULL ptr check in amd_pstate_update
PATCH 1/1 cpufreq/amd-pstate: Add missing NULL ptr check in amd_pstate_update
From: Dhananjay Ugwekar <[email protected]>
[ Upstream commit 426db24d4db2e4f0d6720aeb7795eafcb9e82640 ]
Check if policy is NULL before dereferencing it in amd_pstate_update.
--- drivers/cpufreq/amd-pstate.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/cpufreq/amd-pstate.c +3 -0
@@ -482,6 +482,9 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf,u32 nominal_perf =READ_ONCE (cpudata->nominal_perf);u64 value = prev; +if (!policy) +return ; + min_perf = clamp_t(unsigned long, min_perf, cpudata->min_limit_perf, cpudata->max_limit_perf); max_perf = clamp_t(unsigned long, max_perf, cpudata->min_limit_perf,
Signature · 1 line
2.34.1
Sasha Levin
maintainer[ Sasha's backport helper bot ]
Hi,
✅ All tests passed successfully. No issues detected. No action required from the submitter.
The upstream commit SHA1 provided is correct: 426db24d4db2e4f0d6720aeb7795eafcb9e82640
WARNING: Author mismatch between patch and upstream commit:
Backport author: [email protected]
Commit author: Dhananjay Ugwekar<[email protected]>
Status in newer kernel trees:
6.15.y | Present (exact SHA1)
Note: The patch differs from the upstream commit:
---
1: 426db24d4db2e < -: ------------- cpufreq/amd-pstate: Add missing NULL ptr check in amd_pstate_update -: ------------- > 1: d77c661c72a28 cpufreq/amd-pstate: Add missing NULL ptr check in amd_pstate_update
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.12.y | Success | Success |