Skip to content
Commit 2bbe84fb authored by Nicola Mazzucato's avatar Nicola Mazzucato Committed by Girish Pathak
Browse files

scmi_perf: Add void handler check



The scmi_perf_message_handler() function does not check for handlers
not present in the handler_table.

Although this does not cause an immediate NULL pointer dereferencing,
cause the sanity is performed against the payload size, the above
function returns an imprecise error.

The error returned in such case is PROTOCOL_ERROR, while it would be
more appropriate to return NOT_SUPPORTED, for optional commands,
according to the specification.

From the specification (4.1.2, Commands)
"Any command that is sent with an unknown protocol_id or message_id
must be responded to with a return value of NOT_SUPPORTED as the
status code".

Therefore properly check for NULL dereferencing and return
the correct SCMI error status.

Unit tests have been modified/added accordingly.

Change-Id: I053ea2b9d3faddfc11cc3cc1a99c760015759ba4
Signed-off-by: Nicola Mazzucato's avatarNicola Mazzucato <nicola.mazzucato@arm.com>
parent 350fcfe8
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