mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 02:50:43 +00:00
hv_netvsc: use kcalloc
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>
This commit is contained in:
parent
9477386687
commit
e53a9c2a5a
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue