Skip to content
Commit 2f15a792 authored by Mohamed Omar Asaker's avatar Mohamed Omar Asaker
Browse files

mod/scmi_power_capping: fix use of uninitialized domain config



Fixes a bug where `domain_ctx->config` was passed to the validation function
before being assigned. The correct behavior is to validate the `config`
parameter first, then assign it to `domain_ctx->config` only if valid.

This change updates `pcapping_core_domain_init()` to pass the received
`config` parameter to `pcapping_core_check_domain_configuration()`.
Assignment to `domain_ctx->config` is performed only after successful
validation.

A unit test has been added to ensure domain initialization fails when
invalid configuration values are provided, and that the domain context
remains uninitialized in such cases.

Signed-off-by: Mohamed Omar Asaker's avatarMohamed Omar Asaker <mohamed.omarasaker@arm.com>
parent 945cc06e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment