Skip to content

Commit ab027c4

Browse files
MrVansudeep-holla
authored andcommitted
firmware: arm_scmi: imx: Correct tx size of scmi_imx_misc_ctrl_set
'struct scmi_imx_misc_ctrl_set_in' has a zero length array in the end, The sizeof will not count 'value[]', and hence Tx size will be smaller than actual size for Tx,and SCMI firmware will flag this as protocol error. Fix this by enlarge the Tx size with 'num * sizeof(__le32)' to count in the size of data. Fixes: 61c9f03 ("firmware: arm_scmi: Add initial support for i.MX MISC protocol") Reviewed-by: Jacky Bai <ping.bai@nxp.com> Tested-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Jason Liu <jason.hui.liu@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Message-Id: <20250123063441.392555-1-peng.fan@oss.nxp.com> (sudeep.holla: Commit rewording and replace hardcoded sizeof(__le32) value) Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
1 parent 2014c95 commit ab027c4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,8 @@ static int scmi_imx_misc_ctrl_set(const struct scmi_protocol_handle *ph,
254254
if (num > max_num)
255255
return -EINVAL;
256256

257-
ret = ph->xops->xfer_get_init(ph, SCMI_IMX_MISC_CTRL_SET, sizeof(*in),
258-
0, &t);
257+
ret = ph->xops->xfer_get_init(ph, SCMI_IMX_MISC_CTRL_SET,
258+
sizeof(*in) + num * sizeof(__le32), 0, &t);
259259
if (ret)
260260
return ret;
261261

0 commit comments

Comments
 (0)