qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] linux-user: don't zero a buffer twice
@ 2009-10-02 12:10 Paul Bolle
  0 siblings, 0 replies; only message in thread
From: Paul Bolle @ 2009-10-02 12:10 UTC (permalink / raw)
  To: qemu-devel

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 <pebolle@tiscali.nl>
---
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);
-- 
1.6.5.rc2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-10-02 12:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-02 12:10 [Qemu-devel] [PATCH] linux-user: don't zero a buffer twice Paul Bolle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).