]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
firmware: arm_scmi: Read sensor config as 32-bit value
authorSudeep Holla <sudeep.holla@kernel.org>
Sun, 17 May 2026 19:02:40 +0000 (20:02 +0100)
committerSudeep Holla <sudeep.holla@kernel.org>
Wed, 20 May 2026 09:00:09 +0000 (10:00 +0100)
The SENSOR_CONFIG_GET response contains a 32-bit sensor_config field,
and the xfer is initialized with a 4-byte RX buffer. Reading it with
get_unaligned_le64() can consume bytes past the returned payload.

Use get_unaligned_le32() to match the protocol layout and the allocated
response size.

Fixes: 7b83c5f41088 ("firmware: arm_scmi: Add SCMI v3.0 sensor configuration support")
Link: https://patch.msgid.link/20260517-scmi_fixes-v1-1-d86daec4defd@kernel.org
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
drivers/firmware/arm_scmi/sensors.c

index 882d55f987d22748ecf4a322f7bc2479da55e709..836c294a9f42ae71162e865624694050d72235d5 100644 (file)
@@ -793,7 +793,7 @@ static int scmi_sensor_config_get(const struct scmi_protocol_handle *ph,
        if (!ret) {
                struct scmi_sensor_info *s = si->sensors + sensor_id;
 
-               *sensor_config = get_unaligned_le64(t->rx.buf);
+               *sensor_config = get_unaligned_le32(t->rx.buf);
                s->sensor_config = *sensor_config;
        }