projects
/
elmcan.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve error handling in case of stray characters
[elmcan.git]
/
module
/
elmcan.c
diff --git
a/module/elmcan.c
b/module/elmcan.c
index c1e665e722c62ff378c017c0ff7f1f61a4daf519..49df7c1600ca993703e97811f3f5227d8822095f 100644
(file)
--- a/
module/elmcan.c
+++ b/
module/elmcan.c
@@
-396,8
+396,11
@@
static void elm327_parse_error(struct elmcan *elm, int len)
}
break;
default:
}
break;
default:
- /* Don't emit an error frame if we're unsure */
- return;
+ /* Something else has happened.
+ * Maybe garbage on the UART line.
+ * Emit a generic error frame.
+ */
+ break;
}
elm327_feed_frame_to_netdev(elm, &frame);
}
elm327_feed_frame_to_netdev(elm, &frame);
@@
-451,7
+454,6
@@
static int elm327_parse_frame(struct elmcan *elm, int len)
/* The line is likely garbled anyway, so bail.
* The main code will restart listening.
*/
/* The line is likely garbled anyway, so bail.
* The main code will restart listening.
*/
- elm327_kick_into_cmd_mode(elm);
return -ENODATA;
}
return -ENODATA;
}