diff options
author | Wu Fengguang <fengguang.wu@intel.com> | 2010-02-05 15:02:13 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-02-23 07:37:54 -0800 |
commit | 483d7142396f0d8b8f8748a4069b71c13ca662e5 (patch) | |
tree | 7a28636afd1ccbd59bc762f00b933231303a8754 /drivers/char | |
parent | 6b344d83ca458327faa0e1f6afd45c39cceab2a6 (diff) |
devmem: fix kmem write bug on memory holes
commit c85e9a97c4102ce2e83112da850d838cfab5ab13 upstream
devmem: fix kmem write bug on memory holes
[ cebbert@redhat.com : backport to 2.6.32 ]
write_kmem() used to assume vwrite() always return the full buffer length.
However now vwrite() could return 0 to indicate memory hole. This
creates a bug that "buf" is not advanced accordingly.
Fix it to simply ignore the return value, hence the memory hole.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Tejun Heo <tj@kernel.org>
Cc: Nick Piggin <npiggin@suse.de>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Chuck Ebbert <cebbert@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/mem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 96b2586d2bec..aef3fb42150e 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -593,7 +593,7 @@ static ssize_t write_kmem(struct file * file, const char __user * buf, break; } } - len = vwrite(kbuf, (char *)p, len); + vwrite(kbuf, (char *)p, len); count -= len; buf += len; virtr += len; |