public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* patch "iio: light: apds9306: Fix error handing" added to char-misc-linus
@ 2024-07-03 14:17 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2024-07-03 14:17 UTC (permalink / raw)
  To: muditsharma.info, Jonathan.Cameron, Stable, subhajit.ghosh


This is a note to let you know that I've just added the patch titled

    iio: light: apds9306: Fix error handing

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-linus 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 hopefully also be merged in Linus's tree for the
next -rc kernel release.

If you have any questions about this process, please let me know.


From 1a5cba43096c9242fab503a40b053ec6b93d313a Mon Sep 17 00:00:00 2001
From: Mudit Sharma <muditsharma.info@gmail.com>
Date: Tue, 25 Jun 2024 22:02:01 +0100
Subject: iio: light: apds9306: Fix error handing

The return value of 'iio_gts_find_int_time_by_sel()' is assigned to
variable 'intg_old' but value of 'ret' is checked for error. Update to
use 'intg_old' for error checking.

Fixes: 620d1e6c7a3f ("iio: light: Add support for APDS9306 Light Sensor")
Signed-off-by: Mudit Sharma <muditsharma.info@gmail.com>
Reviewed-by: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com>
Link: https://patch.msgid.link/20240625210203.522179-1-muditsharma.info@gmail.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/iio/light/apds9306.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/light/apds9306.c b/drivers/iio/light/apds9306.c
index d6627b3e6000..66a063ea3db4 100644
--- a/drivers/iio/light/apds9306.c
+++ b/drivers/iio/light/apds9306.c
@@ -583,8 +583,8 @@ static int apds9306_intg_time_set(struct apds9306_data *data, int val2)
 		return ret;
 
 	intg_old = iio_gts_find_int_time_by_sel(&data->gts, intg_time_idx);
-	if (ret < 0)
-		return ret;
+	if (intg_old < 0)
+		return intg_old;
 
 	if (intg_old == val2)
 		return 0;
-- 
2.45.2



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-07-03 14:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-03 14:17 patch "iio: light: apds9306: Fix error handing" added to char-misc-linus gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox