Skip to content

Commit 70171ed

Browse files
Aashish Sharmajic23
authored andcommitted
iio:proximity:sx9324: Check ret value of device_property_read_u32_array()
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: a8ee3b3 ("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]>
1 parent bf74514 commit 70171ed

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/iio/proximity/sx9324.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,9 @@ sx9324_get_default_reg(struct device *dev, int idx,
885885
break;
886886
ret = device_property_read_u32_array(dev, prop, pin_defs,
887887
ARRAY_SIZE(pin_defs));
888+
if (ret)
889+
break;
890+
888891
for (pin = 0; pin < SX9324_NUM_PINS; pin++)
889892
raw |= (pin_defs[pin] << (2 * pin)) &
890893
SX9324_REG_AFE_PH0_PIN_MASK(pin);

0 commit comments

Comments
 (0)