summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Stezenbach <devnull@localhost>2004-02-10 11:27:57 +0000
committerJohannes Stezenbach <devnull@localhost>2004-02-10 11:27:57 +0000
commit21059300be791fe4d0c13b6ef5fdd534e7f6b44e (patch)
tree8cec533be937e0f358e1c447ba798b9c348b4f6c
parent29d96ce5fe39734cf0d8a14880508272bc106e8c (diff)
downloadmediapointer-dvb-s2-21059300be791fe4d0c13b6ef5fdd534e7f6b44e.tar.gz
mediapointer-dvb-s2-21059300be791fe4d0c13b6ef5fdd534e7f6b44e.tar.bz2
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 :-(
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c4
1 files 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;
}