This is a note to let you know that I've just added the patch titled firmware: arm_scmi: Fix signed error return values handling to the 6.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: firmware-arm_scmi-fix-signed-error-return-values-han.patch and it can be found in the queue-6.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 13177df03b164bb5d565e4d0fe3c6cfeea331481 Author: Sukrut Bellary <sukrut.bellary@xxxxxxxxx> Date: Tue Jul 18 01:55:29 2023 -0700 firmware: arm_scmi: Fix signed error return values handling [ Upstream commit 81b233b8dd72f2d1df3da8bd4bd4f8c5e84937b9 ] Handle signed error return values returned by simple_write_to_buffer(). In case of an error, return the error code. Fixes: 3c3d818a9317 ("firmware: arm_scmi: Add core raw transmission support") Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Signed-off-by: Sukrut Bellary <sukrut.bellary@xxxxxxxxx> Reviewed-by: Cristian Marussi <cristian.marussi@xxxxxxx> Tested-by: Cristian Marussi <cristian.marussi@xxxxxxx> Reviewed-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Link: https://lore.kernel.org/r/20230718085529.258899-1-sukrut.bellary@xxxxxxxxx Signed-off-by: Sudeep Holla <sudeep.holla@xxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/firmware/arm_scmi/raw_mode.c b/drivers/firmware/arm_scmi/raw_mode.c index 6971dcf72fb99..0493aa3c12bf5 100644 --- a/drivers/firmware/arm_scmi/raw_mode.c +++ b/drivers/firmware/arm_scmi/raw_mode.c @@ -818,10 +818,13 @@ static ssize_t scmi_dbg_raw_mode_common_write(struct file *filp, * before sending it with a single RAW xfer. */ if (rd->tx_size < rd->tx_req_size) { - size_t cnt; + ssize_t cnt; cnt = simple_write_to_buffer(rd->tx.buf, rd->tx.len, ppos, buf, count); + if (cnt < 0) + return cnt; + rd->tx_size += cnt; if (cnt < count) return cnt;