From 21059300be791fe4d0c13b6ef5fdd534e7f6b44e Mon Sep 17 00:00:00 2001 From: Johannes Stezenbach Date: Tue, 10 Feb 2004 11:27:57 +0000 Subject: fix dvb_ringbuffer_read/write() buffer pointer bug I'm deeply worried why a) this went unnoticed for so long, and b) why I don't see any improvement after this fix. Something strange is going on here :-( --- linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c b/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c index b6469aa2c..1db637351 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c @@ -123,7 +123,7 @@ ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf, size_t len, in if (copy_to_user(buf, rbuf->data+rbuf->pread, todo)) return -EFAULT; - rbuf->pread = (rbuf->pread + len) % rbuf->size; + rbuf->pread = (rbuf->pread + todo) % rbuf->size; return len; } @@ -155,7 +155,7 @@ ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf, if (copy_from_user(rbuf->data+rbuf->pwrite, buf, todo)) return -EFAULT; - rbuf->pwrite = (rbuf->pwrite + len) % rbuf->size; + rbuf->pwrite = (rbuf->pwrite + todo) % rbuf->size; return len; } -- cgit v1.2.3