diff options
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r-- | drivers/net/virtio_net.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 15b9a83bbd9d..b6c9a2af3732 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -2552,7 +2552,7 @@ static int virtnet_find_vqs(struct virtnet_info *vi) | |||
2552 | virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ); | 2552 | virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ); |
2553 | 2553 | ||
2554 | /* Allocate space for find_vqs parameters */ | 2554 | /* Allocate space for find_vqs parameters */ |
2555 | vqs = kzalloc(total_vqs * sizeof(*vqs), GFP_KERNEL); | 2555 | vqs = kcalloc(total_vqs, sizeof(*vqs), GFP_KERNEL); |
2556 | if (!vqs) | 2556 | if (!vqs) |
2557 | goto err_vq; | 2557 | goto err_vq; |
2558 | callbacks = kmalloc_array(total_vqs, sizeof(*callbacks), GFP_KERNEL); | 2558 | callbacks = kmalloc_array(total_vqs, sizeof(*callbacks), GFP_KERNEL); |
@@ -2562,7 +2562,7 @@ static int virtnet_find_vqs(struct virtnet_info *vi) | |||
2562 | if (!names) | 2562 | if (!names) |
2563 | goto err_names; | 2563 | goto err_names; |
2564 | if (!vi->big_packets || vi->mergeable_rx_bufs) { | 2564 | if (!vi->big_packets || vi->mergeable_rx_bufs) { |
2565 | ctx = kzalloc(total_vqs * sizeof(*ctx), GFP_KERNEL); | 2565 | ctx = kcalloc(total_vqs, sizeof(*ctx), GFP_KERNEL); |
2566 | if (!ctx) | 2566 | if (!ctx) |
2567 | goto err_ctx; | 2567 | goto err_ctx; |
2568 | } else { | 2568 | } else { |
@@ -2626,10 +2626,10 @@ static int virtnet_alloc_queues(struct virtnet_info *vi) | |||
2626 | vi->ctrl = kzalloc(sizeof(*vi->ctrl), GFP_KERNEL); | 2626 | vi->ctrl = kzalloc(sizeof(*vi->ctrl), GFP_KERNEL); |
2627 | if (!vi->ctrl) | 2627 | if (!vi->ctrl) |
2628 | goto err_ctrl; | 2628 | goto err_ctrl; |
2629 | vi->sq = kzalloc(sizeof(*vi->sq) * vi->max_queue_pairs, GFP_KERNEL); | 2629 | vi->sq = kcalloc(vi->max_queue_pairs, sizeof(*vi->sq), GFP_KERNEL); |
2630 | if (!vi->sq) | 2630 | if (!vi->sq) |
2631 | goto err_sq; | 2631 | goto err_sq; |
2632 | vi->rq = kzalloc(sizeof(*vi->rq) * vi->max_queue_pairs, GFP_KERNEL); | 2632 | vi->rq = kcalloc(vi->max_queue_pairs, sizeof(*vi->rq), GFP_KERNEL); |
2633 | if (!vi->rq) | 2633 | if (!vi->rq) |
2634 | goto err_rq; | 2634 | goto err_rq; |
2635 | 2635 | ||