iio: pressure: bmp280: Fix uninitialized variable

clang found that the "offset" in bmp580_trigger_handler doesn't get
initialized before access. Add proper initialization to this variable.

Signed-off-by: Yo-Jung Lin (Leo) <0xff07@gmail.com>
Link: https://patch.msgid.link/20241011115334.367736-1-0xff07@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Yo-Jung (Leo) Lin
2024-10-11 19:52:24 +08:00
committed by Jonathan Cameron
parent 220c71dafa
commit f32ea7aab3

View File

@@ -2222,6 +2222,8 @@ static irqreturn_t bmp580_trigger_handler(int irq, void *p)
goto out;
}
offset = 0;
/* Pressure calculations */
memcpy(&data->sensor_data[offset], &data->buf[3], 3);