qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 31/31] eepro100: replace g_malloc()+memcpy() wit


From: Jason Wang
Subject: Re: [Qemu-devel] [PATCH 31/31] eepro100: replace g_malloc()+memcpy() with g_memdup()
Date: Fri, 23 Jun 2017 16:46:14 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1



On 2017年06月22日 21:09, Stefan Weil wrote:
Am 22.06.2017 um 14:42 schrieb Marc-André Lureau:
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>
---
  hw/net/eepro100.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
index 4bf71f2d85..7d3b2e52c7 100644
--- a/hw/net/eepro100.c
+++ b/hw/net/eepro100.c
@@ -1894,8 +1894,7 @@ static void e100_nic_realize(PCIDevice *pci_dev, Error 
**errp)
qemu_register_reset(nic_reset, s); - s->vmstate = g_malloc(sizeof(vmstate_eepro100));
-    memcpy(s->vmstate, &vmstate_eepro100, sizeof(vmstate_eepro100));
+    s->vmstate = g_memdup(&vmstate_eepro100, sizeof(vmstate_eepro100));
      s->vmstate->name = qemu_get_queue(s->nic)->model;
      vmstate_register(&pci_dev->qdev, -1, s->vmstate, s);
  }

Reviewed-by: Stefan Weil <address@hidden>


Reviewed-by: Jason Wang <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]