mirror of
https://github.com/torvalds/linux.git
synced 2026-07-07 05:41:39 +02:00
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>
This commit is contained in:
parent
8a742f785b
commit
9e2f2c4fb9
|
|
@ -257,9 +257,8 @@ aim_read(struct file *filp, char __user *buf, size_t count, loff_t *offset)
|
|||
|
||||
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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user