From: Jan Blunck Date: Wed, 28 Apr 2010 01:48:52 +0000 (-0700) Subject: drivers/sbus/char/flash.c: flash_read should update ppos instead of file->f_pos X-Git-Tag: firefly_0821_release~9833^2~2112^2~1 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=be94bbb5db4de0f3a2a5405511ea3ebea261f2c8;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Andrew Morton Signed-off-by: David S. Miller --- diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c index 19f255b97c86..d3b62eb0fba7 100644 --- a/drivers/sbus/char/flash.c +++ b/drivers/sbus/char/flash.c @@ -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; }