Skip to content
Permalink
Browse files

drivers: adxl362: fix control flow issue

The return code check and error return on the interrupt register
configuration function call should be included in the #if defined
region.

Fixes #16159

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
  • Loading branch information...
bwitherspoon authored and MaureenHelm committed May 15, 2019
1 parent 927012d commit 4cc486ec4f991cdf48847f0b67931e5fee7e87c5
Showing with 6 additions and 7 deletions.
  1. +6 −7 drivers/sensor/adxl362/adxl362.c
@@ -780,14 +780,13 @@ static int adxl362_init(struct device *dev)
return -EIO;
}

err = adxl362_interrupt_config(dev,
config->int1_config,
config->int2_config);
#endif

if (err) {
return err;
if (adxl362_interrupt_config(dev,
config->int1_config,
config->int2_config) < 0) {
LOG_ERR("Failed to configure interrupt");
return -EIO;
}
#endif

return 0;
}

0 comments on commit 4cc486e

Please sign in to comment.
You can’t perform that action at this time.