]> Git Repo - linux.git/commitdiff
iio:proximity:sx9324: Check ret value of device_property_read_u32_array()
authorAashish Sharma <[email protected]>
Mon, 13 Jun 2022 23:22:24 +0000 (16:22 -0700)
committerJonathan Cameron <[email protected]>
Sun, 19 Jun 2022 16:22:49 +0000 (17:22 +0100)
0-day reports:

drivers/iio/proximity/sx9324.c:868:3: warning: Value stored
to 'ret' is never read [clang-analyzer-deadcode.DeadStores]

Put an if condition to break out of switch if ret is non-zero.

Signed-off-by: Aashish Sharma <[email protected]>
Fixes: a8ee3b32f5da ("iio:proximity:sx9324: Add dt_binding support")
Reported-by: kernel test robot <[email protected]>
[[email protected]: Reword commit subject, add fixes tag]
Signed-off-by: Stephen Boyd <[email protected]>
Reviewed-by: Gwendal Grignou <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Cc: <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
drivers/iio/proximity/sx9324.c

index 70c37f664f6da7c2cf2cba5a2007e0836375d5e3..63fbcaa4cac81b6a7b712c6dff651bb9a210511a 100644 (file)
@@ -885,6 +885,9 @@ sx9324_get_default_reg(struct device *dev, int idx,
                        break;
                ret = device_property_read_u32_array(dev, prop, pin_defs,
                                                     ARRAY_SIZE(pin_defs));
+               if (ret)
+                       break;
+
                for (pin = 0; pin < SX9324_NUM_PINS; pin++)
                        raw |= (pin_defs[pin] << (2 * pin)) &
                               SX9324_REG_AFE_PH0_PIN_MASK(pin);
This page took 0.060961 seconds and 4 git commands to generate.