From ad2c19937e0b80f8037e411f72e6d6078fe673ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 7 Jun 2017 00:45:43 +0400 Subject: i386: replace g_malloc()+memcpy() with g_memdup() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I found these pattern via grepping the source tree. I don't have a coccinelle script for it! Signed-off-by: Marc-André Lureau Reviewed-by: Eduardo Habkost Reviewed-by: Richard Henderson --- hw/i386/multiboot.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'hw/i386') diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c index f13e231..6001f4c 100644 --- a/hw/i386/multiboot.c +++ b/hw/i386/multiboot.c @@ -352,8 +352,7 @@ int load_multiboot(FWCfgState *fw_cfg, mb_debug(" mb_mods_count = %d\n", mbs.mb_mods_count); /* save bootinfo off the stack */ - mb_bootinfo_data = g_malloc(sizeof(bootinfo)); - memcpy(mb_bootinfo_data, bootinfo, sizeof(bootinfo)); + mb_bootinfo_data = g_memdup(bootinfo, sizeof(bootinfo)); /* Pass variables to option rom */ fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_ENTRY, mh_entry_addr); -- cgit v1.1