Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be94bbb5 authored by Jan Blunck's avatar Jan Blunck Committed by David S. Miller
Browse files

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: default avatarJan Blunck <jblunck@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 667f0cee
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ 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)
@@ -118,7 +118,7 @@ flash_read(struct file * file, char __user * buf,
		buf++;
	}

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