linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: Fix uninitialized variable
@ 2024-10-11  9:37 Yo-Jung (Leo) Lin
  2024-10-11 10:54 ` Andy Shevchenko
  2024-10-11 11:52 ` [PATCH v2] " Yo-Jung (Leo) Lin
  0 siblings, 2 replies; 9+ messages in thread
From: Yo-Jung (Leo) Lin @ 2024-10-11  9:37 UTC (permalink / raw)
  Cc: linux-kernel-mentees, ricardo, skhan, 0xff07, Jonathan Cameron,
	Lars-Peter Clausen, Nathan Chancellor, Nick Desaulniers,
	Bill Wendling, Justin Stitt, Vasileios Amoiridis, Andy Shevchenko,
	Angel Iglesias, Adam Rizkalla, linux-iio, linux-kernel, llvm

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 (Leo) Lin <0xff07@gmail.com>
---
 drivers/iio/pressure/bmp280-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c
index f4df222ed0c3..7d4151826b86 100644
--- a/drivers/iio/pressure/bmp280-core.c
+++ b/drivers/iio/pressure/bmp280-core.c
@@ -2210,7 +2210,7 @@ static irqreturn_t bmp580_trigger_handler(int irq, void *p)
 	struct iio_poll_func *pf = p;
 	struct iio_dev *indio_dev = pf->indio_dev;
 	struct bmp280_data *data = iio_priv(indio_dev);
-	int ret, offset;
+	int ret, offset = 0;
 
 	guard(mutex)(&data->lock);
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-10-12 10:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-11  9:37 [PATCH] iio: Fix uninitialized variable Yo-Jung (Leo) Lin
2024-10-11 10:54 ` Andy Shevchenko
2024-10-11 11:02   ` Javier Carrasco
2024-10-11 11:52 ` [PATCH v2] " Yo-Jung (Leo) Lin
2024-10-11 12:31   ` Javier Carrasco
2024-10-11 15:01     ` Yo-Jung Lin
2024-10-11 18:32     ` Vasileios Aoiridis
2024-10-11 19:32       ` Javier Carrasco
2024-10-12 10:49         ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).