提交 ad2c1993 编写于 作者: M Marc-André Lureau

i386: replace g_malloc()+memcpy() with g_memdup()

I found these pattern via grepping the source tree. I don't have a
coccinelle script for it!
Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: NEduardo Habkost <ehabkost@redhat.com>
Reviewed-by: NRichard Henderson <rth@twiddle.net>
上级 18a1f0d7
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册