summaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authornorly <ny-git@enpas.org>2019-01-31 01:49:33 +0100
committernorly <ny-git@enpas.org>2019-01-31 01:51:27 +0100
commit70bace7e0c1c7c2f38ce8748b2e6fb375b5748f6 (patch)
tree04eeea82059cfc9955a61a6ba0e295bf7b7bce13 /module
parent87fef6c9778e24eb4317b347d6647d5d31d1a57b (diff)
Return cleanly in functions calling elm327_hw_failure()
Diffstat (limited to 'module')
-rw-r--r--module/elmcan.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/module/elmcan.c b/module/elmcan.c
index fee83c5..854ff59 100644
--- a/module/elmcan.c
+++ b/module/elmcan.c
@@ -173,6 +173,7 @@ static void elm327_send(struct elmcan *elm, const void *buf, size_t len)
if (actual < 0) {
netdev_err(elm->dev, "Failed to write to tty %s.\n", elm->tty->name);
elm327_hw_failure(elm);
+ return;
}
elm->txleft = len - actual;
@@ -678,6 +679,7 @@ static void elm327_parse_rxbuf(struct elmcan *elm)
*/
pr_err("RX buffer overflow. Faulty ELM327 connected?\n");
elm327_hw_failure(elm);
+ return;
} else if (len == elm->rxfill) {
if (elm->state == ELM_RECEIVING
&& elm->rxbuf[elm->rxfill - 1] == ELM327_READY_CHAR) {
@@ -983,6 +985,8 @@ static void elmcan_ldisc_tx_worker(struct work_struct *work)
if (actual < 0) {
netdev_err(elm->dev, "Failed to write to tty %s.\n", elm->tty->name);
elm327_hw_failure(elm);
+ spin_unlock_bh(&elm->lock);
+ return;
}
elm->txleft -= actual;