Skip to content
Commit adb02bdb authored by Tomás Agustín González Orlando's avatar Tomás Agustín González Orlando Committed by tarek-arm
Browse files

mod_scmi_clock: Fix Resource Permissions returned error



Some scmi tests are failing when building with resource
permissions enabled for some platforms.
When trying to access an incorrect clock or sending an
invalid parameter, the NOT_FOUND or the INVALID_PARAMETER
returns are expected by the test instead of the DENIED error.

Fix the logic so that the first thing that each clock handler does
is check whether the requested clock is available and only then
check whether the correct permissions are given to operate on said
clock.

The disadvantage of this implementation is that every new handler
will need to make sure that permissions are satisfied, while
currently we only perform the permissions check before moving to
the respective handlers. However, placing this function call in the
message_handler would imply having to get the clock_id and check
whether it exists/is valid, duplicating
code in the case where resource permissions are enabled.
Hence, this is the preferred solution.

Signed-off-by: Tomás Agustín González Orlando's avatarTomás Agustín González Orlando <tomasagustin.gonzalezorlando@arm.com>
Change-Id: I48dda155e64108555ec933451ea7b888ca64e367
parent ec456bc3
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