From: Stephen Hemminger Date: Tue, 23 Aug 2016 19:17:46 +0000 (-0700) Subject: hv_netvsc: use kcalloc X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e53a9c2a5a8cd0a3a8b3c0f9b7a3ad9bc6a28867;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git hv_netvsc: use kcalloc Better to use kcalloc rather than kzalloc and multiply for an array. Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller --- diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index b15edfc37a59..f64c9781b6cf 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -421,8 +421,8 @@ static int netvsc_init_buf(struct hv_device *device) net_device->map_words = DIV_ROUND_UP(net_device->send_section_cnt, BITS_PER_LONG); - net_device->send_section_map = - kzalloc(net_device->map_words * sizeof(ulong), GFP_KERNEL); + net_device->send_section_map = kcalloc(net_device->map_words, + sizeof(ulong), GFP_KERNEL); if (net_device->send_section_map == NULL) { ret = -ENOMEM; goto cleanup;