summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornorly <ny-git@enpas.org>2019-06-01 15:54:41 +0200
committernorly <ny-git@enpas.org>2019-06-01 16:01:10 +0200
commit5fb4737deaaef9c365b9a8c2c3cf16504254eee7 (patch)
treee706d2579fa2995483701bf6f6cabca89244aa66
parent455c430003db1fbd4030ec3deba4cdf67e0a3158 (diff)
Undo buffer rework for TTY RX
Actually, we fully control the RX buffer, so DMA shouldn't be a concern. Fixes: 40ac32acdae89383ae44f32e612bf37fa0493631
-rw-r--r--module/elmcan.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/module/elmcan.c b/module/elmcan.c
index 8b27c85..2fd861d 100644
--- a/module/elmcan.c
+++ b/module/elmcan.c
@@ -119,7 +119,7 @@ struct elmcan {
int txleft; /* Bytes left to TX */
/* TTY RX helpers */
- unsigned char *rxbuf;
+ unsigned char rxbuf[ELM327_SIZE_RXBUF];
int rxfill;
/* State machine */
@@ -1140,9 +1140,8 @@ static int elmcan_ldisc_open(struct tty_struct *tty)
return -ENFILE;
elm = netdev_priv(dev);
- elm->rxbuf = kmalloc(ELM327_SIZE_RXBUF, GFP_KERNEL);
elm->txbuf = kmalloc(ELM327_SIZE_TXBUF, GFP_KERNEL);
- if (!elm->rxbuf || !elm->txbuf) {
+ if (!elm->txbuf) {
err = -ENOMEM;
goto out_err;
}
@@ -1183,8 +1182,6 @@ static int elmcan_ldisc_open(struct tty_struct *tty)
out_err:
if (elm->txbuf)
kfree(elm->txbuf);
- if (elm->rxbuf)
- kfree(elm->rxbuf);
free_candev(elm->dev);
return err;
}
@@ -1229,7 +1226,6 @@ static void elmcan_ldisc_close(struct tty_struct *tty)
netdev_info(elm->dev, "elmcan off %s.\n", tty->name);
kfree(elm->txbuf);
- kfree(elm->rxbuf);
free_candev(elm->dev);
}