Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[muen/linux.git] / drivers / virtio / virtio_pci_common.c
index 1d4467b2dc317d6ed9b85a4dc04b3bbe06366be2..705aebd74e560cd8d125cee28537e9734dabe518 100644 (file)
@@ -113,12 +113,13 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors,
 
        vp_dev->msix_vectors = nvectors;
 
-       vp_dev->msix_names = kmalloc(nvectors * sizeof *vp_dev->msix_names,
-                                    GFP_KERNEL);
+       vp_dev->msix_names = kmalloc_array(nvectors,
+                                          sizeof(*vp_dev->msix_names),
+                                          GFP_KERNEL);
        if (!vp_dev->msix_names)
                goto error;
        vp_dev->msix_affinity_masks
-               = kzalloc(nvectors * sizeof *vp_dev->msix_affinity_masks,
+               = kcalloc(nvectors, sizeof(*vp_dev->msix_affinity_masks),
                          GFP_KERNEL);
        if (!vp_dev->msix_affinity_masks)
                goto error;