diff options
author | Yo-Jung (Leo) Lin <0xff07@gmail.com> | 2024-10-11 19:52:24 +0800 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2024-10-12 11:49:34 +0100 |
commit | f32ea7aab378d99414a36e448f5f030e32aa9601 (patch) | |
tree | 93333ccf13b7a05a694c9a3205f424775530ac46 /drivers/iio/pressure | |
parent | 220c71dafaa28cbb75fd785670cf68a758347026 (diff) |
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>
Diffstat (limited to 'drivers/iio/pressure')
-rw-r--r-- | drivers/iio/pressure/bmp280-core.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c index f4df222ed0c3..682329f81886 100644 --- a/drivers/iio/pressure/bmp280-core.c +++ b/drivers/iio/pressure/bmp280-core.c @@ -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); |