qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] xen_disk: avoid use of g_malloc0_n()


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [PATCH] xen_disk: avoid use of g_malloc0_n()
Date: Thu, 14 Sep 2017 13:56:24 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

Marc-André can you queue this patch in your gnew series?

On 09/12/2017 11:24 AM, Jan Beulich wrote:
Prefer g_new() / g_new0() to be farther backwards compatible with older
glib versions. As there's no point in zeroing the allocation here (the
loop right afterwards fully initializes the memory), use the former.

Signed-off-by: Jan Beulich <address@hidden>

Reviewed-by: Philippe Mathieu-Daudé <address@hidden>


--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -1232,7 +1232,7 @@ static int blk_connect(struct XenDevice
          return -1;
      }
- domids = g_malloc0_n(blkdev->nr_ring_ref, sizeof(uint32_t));
+    domids = g_new(uint32_t, blkdev->nr_ring_ref);
      for (i = 0; i < blkdev->nr_ring_ref; i++) {
          domids[i] = blkdev->xendev.dom;
      }



reply via email to

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