summaryrefslogtreecommitdiffstats
path: root/drivers/staging/most
diff options
context:
space:
mode:
authorChristian Gromm2015-12-22 10:52:48 +0100
committerGreg Kroah-Hartman2016-02-08 02:34:58 +0100
commit9e2f2c4fb93a12e20f6bd82e1b9bf3df36236198 (patch)
treec33a8c5c39646e7334ea395c06f8a81c1354b025 /drivers/staging/most
parentstaging: most: fix mbo leak (diff)
downloadkernel-qcow2-linux-9e2f2c4fb93a12e20f6bd82e1b9bf3df36236198.tar.gz
kernel-qcow2-linux-9e2f2c4fb93a12e20f6bd82e1b9bf3df36236198.tar.xz
kernel-qcow2-linux-9e2f2c4fb93a12e20f6bd82e1b9bf3df36236198.zip
staging: most: fix tracking of MBO offset
This patch increments mbo_offs by the number of bytes that have been copied and resets it in case a complete mbo has been transferred to user buffer. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/most')
-rw-r--r--drivers/staging/most/aim-cdev/cdev.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/most/aim-cdev/cdev.c b/drivers/staging/most/aim-cdev/cdev.c
index 86194ce51472..0141293b4bf5 100644
--- a/drivers/staging/most/aim-cdev/cdev.c
+++ b/drivers/staging/most/aim-cdev/cdev.c
@@ -257,9 +257,8 @@ start_copy:
copied = to_copy - not_copied;
- if (count < mbo->processed_length) {
- channel->mbo_offs = copied;
- } else {
+ channel->mbo_offs += copied;
+ if (channel->mbo_offs >= mbo->processed_length) {
most_put_mbo(mbo);
channel->mbo_offs = 0;
channel->stacked_mbo = NULL;