Skip to content

Commit

Permalink
drivers/sbus/char/flash.c: flash_read should update ppos instead of f…
Browse files Browse the repository at this point in the history
…ile->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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Jan Blunck authored and davem330 committed Apr 28, 2010
1 parent 667f0ce commit be94bbb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/sbus/char/flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -118,7 +118,7 @@ flash_read(struct file * file, char __user * buf,
buf++;
}

file->f_pos += count;
*ppos += count;
return count;
}

Expand Down

0 comments on commit be94bbb

Please sign in to comment.