summaryrefslogtreecommitdiff
path: root/cethcan
diff options
context:
space:
mode:
authorChristian Franke <nobody@nowhere.ws>2016-10-14 01:54:51 +0200
committerChristian Franke <nobody@nowhere.ws>2016-10-14 01:54:51 +0200
commita55daf0b6c2930660499e40a455bd1011f44f1eb (patch)
tree1be7b64ad5ee0a28ab4819c3e7793eb7b94e63da /cethcan
parent1052134571f0ccf32091d7ca4889a67e9b4399e5 (diff)
Fix crash in ttydmx.c
Diffstat (limited to 'cethcan')
-rw-r--r--cethcan/ttydmx.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cethcan/ttydmx.c b/cethcan/ttydmx.c
index 45d8b5b..f07ce38 100644
--- a/cethcan/ttydmx.c
+++ b/cethcan/ttydmx.c
@@ -256,6 +256,8 @@ int ttydmx_init_conf(json_t *config)
serial.flags &= ~ASYNC_SPD_MASK;
serial.flags |= ASYNC_SPD_CUST;
serial.custom_divisor = serial.baud_base / 250000;
+ if (!serial.custom_divisor)
+ goto out_setup_err;
if (ioctl(sink->fd, TIOCSSERIAL, &serial))
goto out_setup_err;