]> Git Repo - J-linux.git/commitdiff
iio: light: apds9306: Fix error handing
authorMudit Sharma <[email protected]>
Tue, 25 Jun 2024 21:02:01 +0000 (22:02 +0100)
committerJonathan Cameron <[email protected]>
Sat, 29 Jun 2024 17:51:25 +0000 (18:51 +0100)
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 <[email protected]>
Reviewed-by: Subhajit Ghosh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Cc: <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
drivers/iio/light/apds9306.c

index d6627b3e6000edc5e71f092d93bfce523f5167f3..66a063ea3db445b899ebfdd25b3948ed6bef737a 100644 (file)
@@ -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;
This page took 0.046292 seconds and 4 git commands to generate.