diff options
| author | Sivan Zohar-Kotzer <[email protected]> | 2025-07-01 22:13:55 +0000 |
|---|---|---|
| committer | Rafael J. Wysocki <[email protected]> | 2025-07-03 15:19:37 +0000 |
| commit | 46dc57406887dd02565cb264224194a6776d882b (patch) | |
| tree | a42e39b8e3536e765565b68e41cbf1baa109b78e /lib/crypto/mpi/mpi-sub-ui.c | |
| parent | powercap: intel_rapl: Add support for Bartlett Lake platform (diff) | |
| download | kernel-46dc57406887dd02565cb264224194a6776d882b.tar.gz kernel-46dc57406887dd02565cb264224194a6776d882b.zip | |
powercap: dtpm_cpu: Fix NULL pointer dereference in get_pd_power_uw()
The get_pd_power_uw() function can crash with a NULL pointer dereference
when em_cpu_get() returns NULL. This occurs when a CPU becomes impossible
during runtime, causing get_cpu_device() to return NULL, which propagates
through em_cpu_get() and leads to a crash when em_span_cpus() dereferences
the NULL pointer.
Add a NULL check after em_cpu_get() and return 0 if unavailable,
matching the existing fallback behavior in __dtpm_cpu_setup().
Fixes: eb82bace8931 ("powercap/drivers/dtpm: Scale the power with the load")
Signed-off-by: Sivan Zohar-Kotzer <[email protected]>
Link: https://patch.msgid.link/[email protected]
[ rjw: Drop an excess empty code line ]
Signed-off-by: Rafael J. Wysocki <[email protected]>
Diffstat (limited to 'lib/crypto/mpi/mpi-sub-ui.c')
0 files changed, 0 insertions, 0 deletions
