From patchwork Fri Oct 2 12:10:04 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Bolle X-Patchwork-Id: 34843 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2AC0FB7BDE for ; Fri, 2 Oct 2009 22:10:45 +1000 (EST) Received: from localhost ([127.0.0.1]:48933 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtgyA-0001Ip-6y for incoming@patchwork.ozlabs.org; Fri, 02 Oct 2009 08:10:42 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mtgxh-0001Ik-F5 for qemu-devel@nongnu.org; Fri, 02 Oct 2009 08:10:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mtgxc-0001IK-B2 for qemu-devel@nongnu.org; Fri, 02 Oct 2009 08:10:12 -0400 Received: from [199.232.76.173] (port=44421 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mtgxc-0001IG-6X for qemu-devel@nongnu.org; Fri, 02 Oct 2009 08:10:08 -0400 Received: from smtp-out2.tiscali.nl ([195.241.79.177]:40085) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mtgxb-0002cD-MX for qemu-devel@nongnu.org; Fri, 02 Oct 2009 08:10:07 -0400 Received: from [212.123.169.34] (helo=[192.168.1.61]) by smtp-out2.tiscali.nl with esmtp (Exim) (envelope-from ) id 1Mtgxa-0002Rr-DL for qemu-devel@nongnu.org; Fri, 02 Oct 2009 14:10:06 +0200 From: Paul Bolle To: qemu-devel@nongnu.org Date: Fri, 02 Oct 2009 14:10:04 +0200 Message-Id: <1254485404.1738.14.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.28.0 (2.28.0-1.fc12) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH] linux-user: don't zero a buffer twice X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org prepare_binprm() zeroes bprm->buf. That buffer is already zeroed in main() and hasn't been touched since so that is not necessary. Signed-off-by: Paul Bolle --- Just a minor issue that I noticed while reading the code for some other reason. bsd-user/bsdload.c could need a similar patch. I haven't looked at that yet. linux-user/linuxload.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/linux-user/linuxload.c b/linux-user/linuxload.c index 4091bdc..2d778a2 100644 --- a/linux-user/linuxload.c +++ b/linux-user/linuxload.c @@ -96,7 +96,6 @@ static int prepare_binprm(struct linux_binprm *bprm) } } - memset(bprm->buf, 0, sizeof(bprm->buf)); retval = lseek(bprm->fd, 0L, SEEK_SET); if(retval >= 0) { retval = read(bprm->fd, bprm->buf, 128);