Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754972Ab0BSRBB (ORCPT ); Fri, 19 Feb 2010 12:01:01 -0500 Received: from kroah.org ([198.145.64.141]:57700 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754865Ab0BSRAy (ORCPT ); Fri, 19 Feb 2010 12:00:54 -0500 X-Mailbox-Line: From gregkh@kvm.kroah.org Fri Feb 19 08:32:47 2010 Message-Id: <20100219163247.144005727@kvm.kroah.org> User-Agent: quilt/0.48-4.4 Date: Fri, 19 Feb 2010 08:29:53 -0800 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Wu Fengguang , Andi Kleen , Benjamin Herrenschmidt , Christoph Lameter , Ingo Molnar , Tejun Heo , Nick Piggin , KAMEZAWA Hiroyuki , Chuck Ebbert Subject: [60/93] devmem: fix kmem write bug on memory holes In-Reply-To: <20100219165717.GA15002@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1724 Lines: 56 2.6.32-stable review patch. If anyone has any objections, please let us know. ------------------ From: Wu Fengguang 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 Cc: Andi Kleen Cc: Benjamin Herrenschmidt Cc: Christoph Lameter Cc: Ingo Molnar Cc: Tejun Heo Cc: Nick Piggin Cc: KAMEZAWA Hiroyuki Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Cc: Chuck Ebbert Signed-off-by: Greg Kroah-Hartman --- drivers/char/mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -593,7 +593,7 @@ static ssize_t write_kmem(struct file * break; } } - len = vwrite(kbuf, (char *)p, len); + vwrite(kbuf, (char *)p, len); count -= len; buf += len; virtr += len; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/