From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JoJol-0007Wx-2p for qemu-devel@nongnu.org; Tue, 22 Apr 2008 10:49:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JoJoh-0007S3-Up for qemu-devel@nongnu.org; Tue, 22 Apr 2008 10:49:58 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JoJoh-0007Rh-OO for qemu-devel@nongnu.org; Tue, 22 Apr 2008 10:49:55 -0400 Received: from smtp.eu.citrix.com ([62.200.22.115]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JoJoh-0005YR-0k for qemu-devel@nongnu.org; Tue, 22 Apr 2008 10:49:55 -0400 Received: from samy by implementation.famille.thibault.fr with local (Exim 4.69) (envelope-from ) id 1JoJoc-0003Y0-Fg for qemu-devel@nongnu.org; Tue, 22 Apr 2008 16:49:50 +0200 Date: Tue, 22 Apr 2008 15:49:50 +0100 From: Samuel Thibault Message-ID: <20080422144950.GN4416@implementation.uk.xensource.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="jousvV0MzM2p6OtC" Content-Disposition: inline Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH] cpu_physical_memory_rw typo Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --jousvV0MzM2p6OtC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, It looks like there was a typo in cpu_physical_memory_rw: the loop is supposed to copy only l bytes, not len, see patch. Samuel --jousvV0MzM2p6OtC Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename=patch Content-Transfer-Encoding: 8bit Index: exec.c =================================================================== --- exec.c (révision 4233) +++ exec.c (copie de travail) @@ -2540,20 +2540,20 @@ if (!(flags & PAGE_WRITE)) return; /* XXX: this code should not depend on lock_user */ - if (!(p = lock_user(VERIFY_WRITE, addr, len, 0))) + if (!(p = lock_user(VERIFY_WRITE, addr, l, 0))) /* FIXME - should this return an error rather than just fail? */ return; - memcpy(p, buf, len); - unlock_user(p, addr, len); + memcpy(p, buf, l); + unlock_user(p, addr, l); } else { if (!(flags & PAGE_READ)) return; /* XXX: this code should not depend on lock_user */ - if (!(p = lock_user(VERIFY_READ, addr, len, 1))) + if (!(p = lock_user(VERIFY_READ, addr, l, 1))) /* FIXME - should this return an error rather than just fail? */ return; - memcpy(buf, p, len); - unlock_user(p, addr, 0); + memcpy(buf, p, l); + unlock_user(p, addr, l); } len -= l; buf += l; --jousvV0MzM2p6OtC--