Patchwork [4/5] linux-user: don't zero a buffer twice

login
register
mail settings
Submitter Riku Voipio
Date Oct. 16, 2009, 2:02 p.m.
Message ID <e2cc3f6ebe65f98171e07c6097c0bfa9171f6f0e.1255701565.git.riku.voipio@iki.fi>
Download mbox | patch
Permalink /patch/36227/
State New
Headers show

Comments

Riku Voipio - Oct. 16, 2009, 2:02 p.m.
From: Paul Bolle <pebolle@tiscali.nl>

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>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
---
 linux-user/linuxload.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

Patch

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);