summaryrefslogtreecommitdiffstats
path: root/drivers/firmware/arm_scmi/reset.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 19:25:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 19:25:26 +0000
commitef6fed2eb60f1d490dd8c6b7a5ae88c29e77522a (patch)
treec7830d9586142e9f5d69374f645bf313244797bc /drivers/firmware/arm_scmi/reset.c
parentAdding debian version 5.10.216-1. (diff)
downloadlinux-ef6fed2eb60f1d490dd8c6b7a5ae88c29e77522a.tar.xz
linux-ef6fed2eb60f1d490dd8c6b7a5ae88c29e77522a.zip
Merging upstream version 5.10.218.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/firmware/arm_scmi/reset.c')
-rw-r--r--drivers/firmware/arm_scmi/reset.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/firmware/arm_scmi/reset.c b/drivers/firmware/arm_scmi/reset.c
index a981a22cf..b8388a3b9 100644
--- a/drivers/firmware/arm_scmi/reset.c
+++ b/drivers/firmware/arm_scmi/reset.c
@@ -149,8 +149,12 @@ static int scmi_domain_reset(const struct scmi_handle *handle, u32 domain,
struct scmi_xfer *t;
struct scmi_msg_reset_domain_reset *dom;
struct scmi_reset_info *pi = handle->reset_priv;
- struct reset_dom_info *rdom = pi->dom_info + domain;
+ struct reset_dom_info *rdom;
+ if (domain >= pi->num_domains)
+ return -EINVAL;
+
+ rdom = pi->dom_info + domain;
if (rdom->async_reset)
flags |= ASYNCHRONOUS_RESET;