Skip to content

Commit

Permalink
boot, efi: Remove redundant memset()
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
  • Loading branch information
Roy Franz authored and Matt Fleming committed Oct 4, 2013
1 parent 722da9d commit c158c3b
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/firmware/efi/efi-stub-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c158c3b

Please sign in to comment.