hv_netvsc: use kcalloc
authorStephen Hemminger <sthemmin@microsoft.com>
Tue, 23 Aug 2016 19:17:46 +0000 (12:17 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 23 Aug 2016 19:05:36 +0000 (12:05 -0700)
Better to use kcalloc rather than kzalloc and multiply for an array.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hyperv/netvsc.c

index b15edfc37a59ace3cc4d563d13fc1b134f7b5a77..f64c9781b6cfd7cc468f1b156e96d5b9bdc3ba9a 100644 (file)
@@ -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;