diff options
Diffstat (limited to 'net/core/ethtool.c')
-rw-r--r-- | net/core/ethtool.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 7a85367b3c2f..8451ab481095 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
@@ -348,7 +348,7 @@ static noinline_for_stack int ethtool_get_rxnfc(struct net_device *dev, | |||
348 | if (info.cmd == ETHTOOL_GRXCLSRLALL) { | 348 | if (info.cmd == ETHTOOL_GRXCLSRLALL) { |
349 | if (info.rule_cnt > 0) { | 349 | if (info.rule_cnt > 0) { |
350 | if (info.rule_cnt <= KMALLOC_MAX_SIZE / sizeof(u32)) | 350 | if (info.rule_cnt <= KMALLOC_MAX_SIZE / sizeof(u32)) |
351 | rule_buf = kmalloc(info.rule_cnt * sizeof(u32), | 351 | rule_buf = kzalloc(info.rule_cnt * sizeof(u32), |
352 | GFP_USER); | 352 | GFP_USER); |
353 | if (!rule_buf) | 353 | if (!rule_buf) |
354 | return -ENOMEM; | 354 | return -ENOMEM; |
@@ -397,7 +397,7 @@ static noinline_for_stack int ethtool_get_rxfh_indir(struct net_device *dev, | |||
397 | (KMALLOC_MAX_SIZE - sizeof(*indir)) / sizeof(*indir->ring_index)) | 397 | (KMALLOC_MAX_SIZE - sizeof(*indir)) / sizeof(*indir->ring_index)) |
398 | return -ENOMEM; | 398 | return -ENOMEM; |
399 | full_size = sizeof(*indir) + sizeof(*indir->ring_index) * table_size; | 399 | full_size = sizeof(*indir) + sizeof(*indir->ring_index) * table_size; |
400 | indir = kmalloc(full_size, GFP_USER); | 400 | indir = kzalloc(full_size, GFP_USER); |
401 | if (!indir) | 401 | if (!indir) |
402 | return -ENOMEM; | 402 | return -ENOMEM; |
403 | 403 | ||
@@ -538,7 +538,7 @@ static int ethtool_get_rx_ntuple(struct net_device *dev, void __user *useraddr) | |||
538 | 538 | ||
539 | gstrings.len = ret; | 539 | gstrings.len = ret; |
540 | 540 | ||
541 | data = kmalloc(gstrings.len * ETH_GSTRING_LEN, GFP_USER); | 541 | data = kzalloc(gstrings.len * ETH_GSTRING_LEN, GFP_USER); |
542 | if (!data) | 542 | if (!data) |
543 | return -ENOMEM; | 543 | return -ENOMEM; |
544 | 544 | ||
@@ -775,7 +775,7 @@ static int ethtool_get_regs(struct net_device *dev, char __user *useraddr) | |||
775 | if (regs.len > reglen) | 775 | if (regs.len > reglen) |
776 | regs.len = reglen; | 776 | regs.len = reglen; |
777 | 777 | ||
778 | regbuf = kmalloc(reglen, GFP_USER); | 778 | regbuf = kzalloc(reglen, GFP_USER); |
779 | if (!regbuf) | 779 | if (!regbuf) |
780 | return -ENOMEM; | 780 | return -ENOMEM; |
781 | 781 | ||