提交 be94bbb5 编写于 作者: J Jan Blunck 提交者: David S. Miller

drivers/sbus/char/flash.c: flash_read should update ppos instead of file->f_pos

flash_read() updates file->f_pos directly instead of the ppos given.  The
VFS later updates the file->f_pos and overwrites it with the unchanged
value of ppos.
Signed-off-by: NJan Blunck <jblunck@suse.de>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 667f0cee
......@@ -105,9 +105,9 @@ static ssize_t
flash_read(struct file * file, char __user * buf,
size_t count, loff_t *ppos)
{
unsigned long p = file->f_pos;
loff_t p = *ppos;
int i;
if (count > flash.read_size - p)
count = flash.read_size - p;
......@@ -118,7 +118,7 @@ flash_read(struct file * file, char __user * buf,
buf++;
}
file->f_pos += count;
*ppos += count;
return count;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册