firmware: arm_scmi: Fix signed error return values handling
PATCH 1/1 firmware: arm_scmi: Fix signed error return values handling
Handle signed error return values returned by simple_write_to_buffer(). In case of an error, return the error code.
---
This is based on static analysis. Compilation tested.
--- drivers/firmware/arm_scmi/raw_mode.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/firmware/arm_scmi/raw_mode.c +4 -1
@@ -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;
Signature · 1 line
2.34.1
Quoted 7 lines · Sukrut Bellary
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 <[email protected]>Signed-off-by Sukrut Bellary <[email protected]>---
Thanks!
regards,
dan carpenter
Quoted 9 lines · Sukrut Bellary
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 <[email protected]>Signed-off-by Sukrut Bellary <[email protected]>---
This is based on static analysis. Compilation tested.
---
Hi Sukrut,
thanks for this.
Thanks,
Cristian
Sudeep Holla
AppliedQuoted 3 lines · Sukrut Bellary
Handle signed error return values returned by
simple_write_to_buffer(). In case of an error, return the error code.
Applied to sudeep.holla/linux (for-next/scmi/fixes), thanks!
[1/1] firmware: arm_scmi: Fix signed error return values handling
https://git.kernel.org/sudeep.holla/c/81b233b8dd72
--
Regards,
Sudeep
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel