Commit 1901488f authored by Roel Kluin's avatar Roel Kluin Committed by James Toy

If count > 0 and dev->rlen == dev->rpos and dev->proto == 0 then we read

and write dev->rbuf[-1];
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Cc: Harald Welte <laforge@gnumonks.org>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 08e85e31
......@@ -1017,7 +1017,7 @@ static ssize_t cmm_read(struct file *filp, __user char *buf, size_t count,
}
}
if (dev->proto == 0 && count > dev->rlen - dev->rpos) {
if (dev->proto == 0 && count > dev->rlen - dev->rpos && i) {
DEBUGP(4, dev, "T=0 and count > buffer\n");
dev->rbuf[i] = dev->rbuf[i - 1];
dev->rbuf[i - 1] = dev->procbyte;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment