This is an automated email from the ASF dual-hosted git repository.
jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
The following commit(s) were added to refs/heads/master by this push:
new 8abe75d sensors/lis2dh12: Fix control flow in lis2dh12_set_tap_cfg()
8abe75d is described below
commit 8abe75d48b0d698f98fa284ab2b418a7f188fa96
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Fri Sep 27 09:20:02 2019 +0200
sensors/lis2dh12: Fix control flow in lis2dh12_set_tap_cfg()
Code was written with intention of checking return code after
each function call but setting rc variable is missing in obvious
places.
Error found by static code analyzer tool.
---
hw/drivers/sensors/lis2dh12/src/lis2dh12.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/drivers/sensors/lis2dh12/src/lis2dh12.c
b/hw/drivers/sensors/lis2dh12/src/lis2dh12.c
index 98e6407..ea5ba63 100644
--- a/hw/drivers/sensors/lis2dh12/src/lis2dh12.c
+++ b/hw/drivers/sensors/lis2dh12/src/lis2dh12.c
@@ -2981,22 +2981,22 @@ int lis2dh12_set_tap_cfg(struct sensor_itf *itf, struct
lis2dh12_tap_settings *c
return rc;
}
- lis2dh12_set_click_threshold(itf, cfg->click_ths);
+ rc = lis2dh12_set_click_threshold(itf, cfg->click_ths);
if (rc) {
return rc;
}
- lis2dh12_set_click_time_limit(itf, cfg->time_limit);
+ rc = lis2dh12_set_click_time_limit(itf, cfg->time_limit);
if (rc) {
return rc;
}
- lis2dh12_set_click_time_latency(itf, cfg->time_latency);
+ rc = lis2dh12_set_click_time_latency(itf, cfg->time_latency);
if (rc) {
return rc;
}
- lis2dh12_set_click_time_window(itf, cfg->time_window);
+ rc = lis2dh12_set_click_time_window(itf, cfg->time_window);
if (rc) {
return rc;
}