aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Vizzarro <Luca.Vizzarro@arm.com>2020-10-08 19:24:05 +0100
committernicola-mazzucato-arm <42373140+nicola-mazzucato-arm@users.noreply.github.com>2020-10-22 14:39:59 +0100
commit2d55e0556f55e89566acf20d9f5f88c2f0b1ef3e (patch)
tree1b55f32062dee54e1cecb753236454730e246cc8
parent10dea43bffdd9fedb359c929d890a7d5dbc79ca0 (diff)
mod_scmi_reset: Fix RESET_NOTIFY invalid notify_enable
As per section 4.8.2.6 of the SCMI v2 spec, the request notify_enable parameter bits 31 to 1 must be set to zero. With this, this commit enforces this requirement by returning SCMI_INVALID_PARAMETERS whenever any of these bits are set. Change-Id: Ic691254da83941d2179befc3e9209c9dbb7550ff Signed-off-by: Luca Vizzarro <Luca.Vizzarro@arm.com>
-rw-r--r--module/scmi_reset_domain/src/mod_scmi_reset_domain.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/module/scmi_reset_domain/src/mod_scmi_reset_domain.c b/module/scmi_reset_domain/src/mod_scmi_reset_domain.c
index 05bb98c8..895cfbac 100644
--- a/module/scmi_reset_domain/src/mod_scmi_reset_domain.c
+++ b/module/scmi_reset_domain/src/mod_scmi_reset_domain.c
@@ -436,6 +436,12 @@ static int reset_notify_handler(fwk_id_t service_id,
goto exit;
}
+ if ((parameters->notify_enable & ~SCMI_RESET_DOMAIN_DO_NOTIFY) != 0) {
+ status = FWK_SUCCESS;
+ outmsg.status = SCMI_INVALID_PARAMETERS;
+ goto exit;
+ }
+
if (parameters->notify_enable)
scmi_rd_ctx.scmi_notification_api->scmi_notification_add_subscriber(
MOD_SCMI_PROTOCOL_ID_RESET_DOMAIN,