summaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authornorly <ny-git@enpas.org>2019-02-18 00:45:42 +0100
committernorly <ny-git@enpas.org>2019-02-18 00:48:43 +0100
commit88eb76e031c7e01199c501865c4622cec7a59185 (patch)
tree0cb64dfbb26c20c8b0597b2d86ba8347cd222241 /module
parentc34eb30a4e2ef70b1b5b4429d60fcd89579b447c (diff)
Don't try to send garbage after each init script entry
Previously, we'd try to send the local txbuf even though it had not been written to. Thus strlen() would overrun the buffer, which recent Linux versions catch in a BUG_ON().
Diffstat (limited to 'module')
-rw-r--r--module/elmcan.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/module/elmcan.c b/module/elmcan.c
index 14cfe27..3724d97 100644
--- a/module/elmcan.c
+++ b/module/elmcan.c
@@ -579,6 +579,8 @@ static void elm327_handle_prompt(struct elmcan *elm)
*/
elm->state = ELM_NOTINIT;
elm327_kick_into_cmd_mode(elm);
+
+ return;
} else if (test_and_clear_bit(ELM_TODO_SILENT_MONITOR, &elm->cmds_todo)) {
snprintf(txbuf, sizeof(txbuf), "ATCSM%i\r", !(!(elm->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)));
} else if (test_and_clear_bit(ELM_TODO_RESPONSES, &elm->cmds_todo)) {