Commit 37bbffcb authored by Sudeep Holla's avatar Sudeep Holla

firmware: arm_scmi: Remove extra check for invalid length message responses

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: default avatarJim Quinlan <james.quinlan@broadcom.com>
Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
parent 9eefa43a
...@@ -230,12 +230,6 @@ static void scmi_rx_callback(struct mbox_client *cl, void *m) ...@@ -230,12 +230,6 @@ static void scmi_rx_callback(struct mbox_client *cl, void *m)
xfer = &minfo->xfer_block[xfer_id]; xfer = &minfo->xfer_block[xfer_id];
scmi_dump_header_dbg(dev, &xfer->hdr); 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); scmi_fetch_response(xfer, mem);
complete(&xfer->done); complete(&xfer->done);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment