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

[Minios-devel] [UNIKRAFT PATCH] driver/virtio: Replace malloc with calloc



We replace malloc with calloc to zero out the allocated memory.

Signed-off-by: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>
---
 plat/drivers/virtio/virtio_net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plat/drivers/virtio/virtio_net.c b/plat/drivers/virtio/virtio_net.c
index 14e8a27..a5e6729 100644
--- a/plat/drivers/virtio/virtio_net.c
+++ b/plat/drivers/virtio/virtio_net.c
@@ -1063,7 +1063,7 @@ static int virtio_net_add_dev(struct virtio_dev *vdev)
 
        UK_ASSERT(vdev != NULL);
 
-       vndev = uk_malloc(a, sizeof(*vndev));
+       vndev = uk_calloc(a, 1, sizeof(*vndev));
        if (!vndev) {
                rc = -ENOMEM;
                goto err_out;
-- 
2.7.4


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

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