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

[Xen-changelog] [qemu-xen master] xen-disk: use g_new0 to fix build



commit 0b157f8d977a9425e2d8d510aa011c5d4f3ec247
Author:     Olaf Hering <olaf@xxxxxxxxx>
AuthorDate: Fri Jul 28 15:11:51 2017 +0200
Commit:     Anthony PERARD <anthony.perard@xxxxxxxxxx>
CommitDate: Thu Sep 21 13:58:14 2017 +0100

    xen-disk: use g_new0 to fix build
    
    g_malloc0_n is available since glib-2.24. To allow build with older glib
    versions use the generic g_new0, which is already used in many other
    places in the code.
    
    Fixes commit 3284fad728 ("xen-disk: add support for multi-page shared 
rings")
    
    Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
    Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
    Signed-off-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
    (cherry picked from commit a3fd781f653db4dc76635715207c9029208634bd)
---
 hw/block/xen_disk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index d42ed70..536e2ee 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -1232,7 +1232,7 @@ static int blk_connect(struct XenDevice *xendev)
         return -1;
     }
 
-    domids = g_malloc0_n(blkdev->nr_ring_ref, sizeof(uint32_t));
+    domids = g_new0(uint32_t, blkdev->nr_ring_ref);
     for (i = 0; i < blkdev->nr_ring_ref; i++) {
         domids[i] = blkdev->xendev.dom;
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.