patch "iio: chemical: bme680: Fix uninitialized variable in" added to char-misc-next
Subsystems (2)
This is a note to let you know that I've just added the patch titled
iio: chemical: bme680: Fix uninitialized variable in
to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-next branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will also be merged in the next major kernel release during the merge window.
If you have any questions about this process, please let me know.
From 20eb1fae4145bc45717aa8a6d05fcd6a64ed856a Mon Sep 17 00:00:00 2001
From: Dan Carpenter <[email protected]>
Date: Wed, 8 Jan 2025 12:37:22 +0300
Subject: iio: chemical: bme680: Fix uninitialized variable in
__bme680_read_raw()
The bme680_read_temp() function takes a pointer to s16 but we're passing an int pointer to it. This will not work on big endian systems and it also means that the other 16 bits are uninitialized.
Pass an s16 type variable.
--- drivers/iio/chemical/bme680_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/chemical/bme680_core.c +2 -2
@@ -874,11 +874,11 @@ static int bme680_read_raw(struct iio_dev *indio_dev,case IIO_CHAN_INFO_RAW :switch (chan->type) {case IIO_TEMP : - ret =bme680_read_temp (data, (s16 *)&chan_val); + ret =bme680_read_temp (data, &temp_chan_val);if (ret)return ret; - *val = chan_val; + *val = temp_chan_val;return IIO_VAL_INT ;case IIO_PRESSURE : ret =bme680_read_press (data, &chan_val);
Signature · 1 line
2.48.1