]> Git Repo - J-linux.git/commitdiff
iio: pressure: bmp280: Fix uninitialized variable
authorYo-Jung (Leo) Lin <[email protected]>
Fri, 11 Oct 2024 11:52:24 +0000 (19:52 +0800)
committerJonathan Cameron <[email protected]>
Sat, 12 Oct 2024 10:49:34 +0000 (11:49 +0100)
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) <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jonathan Cameron <[email protected]>
drivers/iio/pressure/bmp280-core.c

index f4df222ed0c3c7166c4dbaf73706faf55ca83b51..682329f81886a183402b26e8d170808cfebd3abd 100644 (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);
 
This page took 0.060634 seconds and 4 git commands to generate.