summaryrefslogtreecommitdiffstats
path: root/src/can
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-20 09:08:12 +0000
committerRomain Forlot <romain.forlot@iot.bzh>2017-03-20 09:08:12 +0000
commitc0fd6e1982353d056c26a292186ef0df315adde3 (patch)
tree6dce1b1866aab81b660aaae554c8f16c53f0d2d5 /src/can
parentd99b87ba4332fd0c1e51d2708e46c52bad713558 (diff)
Fix: Avoid segfault if diagnostic bus isn't correctly set.
There is a segfault when binding configuration doesn't matches configuration generated. Improve general CAN bus device initialization. Change-Id: I17ea94ee54841d09ac63a7ffad303a88d99e0173 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/can')
-rw-r--r--src/can/can-bus.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/can/can-bus.cpp b/src/can/can-bus.cpp
index a81c142f..cfb9d86d 100644
--- a/src/can/can-bus.cpp
+++ b/src/can/can-bus.cpp
@@ -240,7 +240,10 @@ int can_bus_t::init_can_dev()
i++;
}
else
+ {
ERROR(binder_interface, "Can't open device %s", device.c_str());
+ return 1;
+ }
}
NOTICE(binder_interface, "Initialized %d/%d can bus device(s)", i, t);