dect
/
linux-2.6
Archived
13
0
Fork 0

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: Jan Blunck <jblunck@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jan Blunck 2010-04-27 18:48:52 -07:00 committed by David S. Miller
parent 667f0cee3e
commit be94bbb5db
1 changed files with 3 additions and 3 deletions

View File

@ -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;
}