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 <nicola.mazzucato@arm.com>
Loading
Please register or sign in to comment