From: Sudeep Holla <sudeep.holla@arm.com>
To: linux-arm-kernel@lists.infradead.org
Cc: Sudeep Holla <sudeep.holla@arm.com>, Peng Fan <peng.fan@nxp.com>,
linux-kernel@vger.kernel.org,
Bo Zhang <bozhang.zhang@broadcom.com>,
Jim Quinlan <james.quinlan@broadcom.com>,
Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
Gaku Inami <gaku.inami.xh@renesas.com>,
Etienne Carriere <etienne.carriere@linaro.org>
Subject: [PATCH v2 3/6] firmware: arm_scmi: Remove extra check for invalid length message responses
Date: Fri, 26 Jul 2019 14:45:28 +0100 [thread overview]
Message-ID: <20190726134531.8928-4-sudeep.holla@arm.com> (raw)
In-Reply-To: <20190726134531.8928-1-sudeep.holla@arm.com>
scmi_xfer_get_init ensures both transmit and receive buffer lengths are
within the maximum limits. If receive buffer length is not supplied by
the caller, it's set to the maximum limit value. Receive buffer length
is never modified after that. So there's no need for the extra check
when receive transmit completion for a command essage.
Further, if the response header length is greater than the prescribed
receive buffer length, the response buffer is truncated to the latter.
Reported-by: Jim Quinlan <james.quinlan@broadcom.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
drivers/firmware/arm_scmi/driver.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index b5bc4c7a8fab..6ef652940099 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -230,12 +230,6 @@ static void scmi_rx_callback(struct mbox_client *cl, void *m)
xfer = &minfo->xfer_block[xfer_id];
scmi_dump_header_dbg(dev, &xfer->hdr);
- /* Is the message of valid length? */
- if (xfer->rx.len > info->desc->max_msg_size) {
- dev_err(dev, "unable to handle %zu xfer(max %d)\n",
- xfer->rx.len, info->desc->max_msg_size);
- return;
- }
scmi_fetch_response(xfer, mem);
complete(&xfer->done);
--
2.17.1
next prev parent reply other threads:[~2019-07-26 13:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-26 13:45 [PATCH v2 0/6] firmware: arm_scmi: miscellaneous fixes/updates Sudeep Holla
2019-07-26 13:45 ` [PATCH v2 1/6] firmware: arm_scmi: Use the correct style for SPDX License Identifier Sudeep Holla
2019-07-26 13:45 ` [PATCH v2 2/6] firmware: arm_scmi: Align few names in sensors protocol with SCMI specification Sudeep Holla
2019-07-26 13:45 ` Sudeep Holla [this message]
2019-07-26 13:45 ` [PATCH v2 4/6] firmware: arm_scmi: Fix few trivial typos in comments Sudeep Holla
2019-07-26 13:45 ` [PATCH v2 5/6] firmware: arm_scmi: Use the term 'message' instead of 'command' Sudeep Holla
2019-07-26 13:45 ` [PATCH v2 6/6] firmware: arm_scmi: Check if platform has released shmem before using Sudeep Holla
2019-08-05 12:33 ` Etienne Carriere
2019-08-05 12:52 ` Sudeep Holla
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190726134531.8928-4-sudeep.holla@arm.com \
--to=sudeep.holla@arm.com \
--cc=bozhang.zhang@broadcom.com \
--cc=etienne.carriere@linaro.org \
--cc=gaku.inami.xh@renesas.com \
--cc=james.quinlan@broadcom.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peng.fan@nxp.com \
--cc=volodymyr_babchuk@epam.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®