linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roy Franz <roy.franz@linaro.org>
To: mingo@kernel.org, linux-kernel@vger.kernel.org,
	linux-efi@vger.kernel.org, matt.fleming@intel.com, hpa@zytor.com
Cc: msalter@redhat.com, patches@linaro.org, Roy Franz <roy.franz@linaro.org>
Subject: [PATCH] Remove redundant and incorrect memset()
Date: Fri,  4 Oct 2013 09:02:46 -0700	[thread overview]
Message-ID: <1380902566-30867-1-git-send-email-roy.franz@linaro.org> (raw)
In-Reply-To: <20131003131054.GB27835@gmail.com>

Remove a redundant memset() call from efi_relocate_kernel() that
was clearing memory that would be used by BSS in non-compressed
images loaded with this function.  This clear was redundant with
the clearing done in the image itself, and also implemented incorrectly
with a 0 length.

Signed-off-by: Roy Franz <roy.franz@linaro.org>
Acked-by: Mark Salter <msalter@redhat.com>
---
 drivers/firmware/efi/efi-stub-helper.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/firmware/efi/efi-stub-helper.c b/drivers/firmware/efi/efi-stub-helper.c
index cc0581d..b6bffbf 100644
--- a/drivers/firmware/efi/efi-stub-helper.c
+++ b/drivers/firmware/efi/efi-stub-helper.c
@@ -567,8 +567,6 @@ static efi_status_t efi_relocate_kernel(efi_system_table_t *sys_table_arg,
 	 * have been allocated by UEFI, so we can safely use memcpy.
 	 */
 	memcpy((void *)new_addr, (void *)cur_image_addr, image_size);
-	/* Zero any extra space we may have allocated for BSS. */
-	memset((void *)(new_addr + image_size), alloc_size - image_size, 0);
 
 	/* Return the new address of the relocated image. */
 	*image_addr = new_addr;
-- 
1.7.10.4

       reply	other threads:[~2013-10-04 16:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20131003131054.GB27835@gmail.com>
2013-10-04 16:02 ` Roy Franz [this message]
2013-10-04 17:33   ` [PATCH] Remove redundant and incorrect memset() Ingo Molnar
2013-10-04 17:38     ` H. Peter Anvin
     [not found]     ` <CAFECyb_ddUU8p87iOZ43PxW3h-E5cJ-0BUEr9i4Z-VrUez6=Jw@mail.gmail.com>
2013-10-04 17:39       ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1380902566-30867-1-git-send-email-roy.franz@linaro.org \
    --to=roy.franz@linaro.org \
    --cc=hpa@zytor.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt.fleming@intel.com \
    --cc=mingo@kernel.org \
    --cc=msalter@redhat.com \
    --cc=patches@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).