[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 27/29] i386: replace g_malloc()+memcpy() with g_memdu
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PULL 27/29] i386: replace g_malloc()+memcpy() with g_memdup() |
Date: |
Thu, 31 Aug 2017 12:34:30 +0200 |
I found these pattern via grepping the source tree. I don't have a
coccinelle script for it!
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
---
hw/i386/multiboot.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c
index f13e23139b..6001f4caa2 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);
--
2.14.1.146.gd35faa819
- [Qemu-devel] [PULL 20/29] usb-hub: use DIV_ROUND_UP, (continued)
- [Qemu-devel] [PULL 20/29] usb-hub: use DIV_ROUND_UP, Marc-André Lureau, 2017/08/31
- [Qemu-devel] [PULL 19/29] q35: use DIV_ROUND_UP, Marc-André Lureau, 2017/08/31
- [Qemu-devel] [PULL 21/29] msix: use DIV_ROUND_UP, Marc-André Lureau, 2017/08/31
- [Qemu-devel] [PULL 22/29] ppc: use DIV_ROUND_UP, Marc-André Lureau, 2017/08/31
- [Qemu-devel] [PULL 25/29] decnumber: use DIV_ROUND_UP, Marc-André Lureau, 2017/08/31
- [Qemu-devel] [PULL 26/29] i386: introduce ELF_NOTE_SIZE macro, Marc-André Lureau, 2017/08/31
- [Qemu-devel] [PULL 23/29] i386/dump: use DIV_ROUND_UP, Marc-André Lureau, 2017/08/31
- [Qemu-devel] [PULL 24/29] kvm: use DIV_ROUND_UP, Marc-André Lureau, 2017/08/31
- [Qemu-devel] [PULL 28/29] test-iov: replace g_malloc()+memcpy() with g_memdup(), Marc-André Lureau, 2017/08/31
- [Qemu-devel] [PULL 29/29] eepro100: replace g_malloc()+memcpy() with g_memdup(), Marc-André Lureau, 2017/08/31
- [Qemu-devel] [PULL 27/29] i386: replace g_malloc()+memcpy() with g_memdup(),
Marc-André Lureau <=
- Re: [Qemu-devel] [PULL 00/29] Code cleanup patches, no-reply, 2017/08/31
- Re: [Qemu-devel] [PULL 00/29] Code cleanup patches, Peter Maydell, 2017/08/31