All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] iio: accel: adxl367: Fix uninitialized variable handled
@ 2022-02-24 21:51 Colin Ian King
  2022-02-26 18:03 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-02-24 21:51 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Cosmin Tanislav,
	Jonathan Cameron, linux-iio
  Cc: kernel-janitors, linux-kernel

Variable handle is not initialized leading to potential garbage
results with the or operations. Fix this by replacing the first
or operation to an assignment to ensure handled is initialized
correctly.

Fixes: cbab791c5e2a ("iio: accel: add ADXL367 driver")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/iio/accel/adxl367.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/accel/adxl367.c b/drivers/iio/accel/adxl367.c
index b452d74b1d4d..350a89b61179 100644
--- a/drivers/iio/accel/adxl367.c
+++ b/drivers/iio/accel/adxl367.c
@@ -884,7 +884,7 @@ static irqreturn_t adxl367_irq_handler(int irq, void *private)
 	if (ret)
 		return IRQ_NONE;
 
-	handled |= adxl367_push_event(indio_dev, status);
+	handled = adxl367_push_event(indio_dev, status);
 	handled |= adxl367_push_fifo_data(indio_dev, status, fifo_entries);
 
 	return handled ? IRQ_HANDLED : IRQ_NONE;
-- 
2.34.1


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

* Re: [PATCH][next] iio: accel: adxl367: Fix uninitialized variable handled
  2022-02-24 21:51 [PATCH][next] iio: accel: adxl367: Fix uninitialized variable handled Colin Ian King
@ 2022-02-26 18:03 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2022-02-26 18:03 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Lars-Peter Clausen, Michael Hennerich, Cosmin Tanislav,
	linux-iio, kernel-janitors, linux-kernel

On Thu, 24 Feb 2022 21:51:49 +0000
Colin Ian King <colin.i.king@gmail.com> wrote:

> Variable handle is not initialized leading to potential garbage
> results with the or operations. Fix this by replacing the first
> or operation to an assignment to ensure handled is initialized
> correctly.
> 
> Fixes: cbab791c5e2a ("iio: accel: add ADXL367 driver")
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Hi Colin,

Nathan's patch hit my inbox first so I applied his but added
an additional Reported-by: for you to reflect you also reported it
via this patch.

Thanks

Jonathan

> ---
>  drivers/iio/accel/adxl367.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/accel/adxl367.c b/drivers/iio/accel/adxl367.c
> index b452d74b1d4d..350a89b61179 100644
> --- a/drivers/iio/accel/adxl367.c
> +++ b/drivers/iio/accel/adxl367.c
> @@ -884,7 +884,7 @@ static irqreturn_t adxl367_irq_handler(int irq, void *private)
>  	if (ret)
>  		return IRQ_NONE;
>  
> -	handled |= adxl367_push_event(indio_dev, status);
> +	handled = adxl367_push_event(indio_dev, status);
>  	handled |= adxl367_push_fifo_data(indio_dev, status, fifo_entries);
>  
>  	return handled ? IRQ_HANDLED : IRQ_NONE;


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

end of thread, other threads:[~2022-02-26 17:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-24 21:51 [PATCH][next] iio: accel: adxl367: Fix uninitialized variable handled Colin Ian King
2022-02-26 18:03 ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.