]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blobdiff - drivers/virt/vboxguest/vboxguest_core.c
treewide: kmalloc() -> kmalloc_array()
[mirror_ubuntu-hirsute-kernel.git] / drivers / virt / vboxguest / vboxguest_core.c
index 2f3856a95856be43bcbfc6a4c3865f7099045368..3093655c7b92718b9c384f2f9791c221eaf258ab 100644 (file)
@@ -69,7 +69,7 @@ static void vbg_guest_mappings_init(struct vbg_dev *gdev)
        /* Add 4M so that we can align the vmap to 4MiB as the host requires. */
        size = PAGE_ALIGN(req->hypervisor_size) + SZ_4M;
 
-       pages = kmalloc(sizeof(*pages) * (size >> PAGE_SHIFT), GFP_KERNEL);
+       pages = kmalloc_array(size >> PAGE_SHIFT, sizeof(*pages), GFP_KERNEL);
        if (!pages)
                goto out;
 
@@ -262,8 +262,9 @@ static int vbg_balloon_inflate(struct vbg_dev *gdev, u32 chunk_idx)
        struct page **pages;
        int i, rc, ret;
 
-       pages = kmalloc(sizeof(*pages) * VMMDEV_MEMORY_BALLOON_CHUNK_PAGES,
-                       GFP_KERNEL | __GFP_NOWARN);
+       pages = kmalloc_array(VMMDEV_MEMORY_BALLOON_CHUNK_PAGES,
+                             sizeof(*pages),
+                             GFP_KERNEL | __GFP_NOWARN);
        if (!pages)
                return -ENOMEM;