From: norly Date: Sun, 17 Feb 2019 23:45:42 +0000 (+0100) Subject: Don't try to send garbage after each init script entry X-Git-Url: https://git.enpas.org/?a=commitdiff_plain;h=88eb76e031c7e01199c501865c4622cec7a59185;p=elmcan.git 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(). --- 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)) {