summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/emulex
diff options
context:
space:
mode:
authorRavikumar Nelavelli <ravikumar.nelavelli@emulex.com>2014-03-11 18:53:06 +0530
committerDavid S. Miller <davem@davemloft.net>2014-03-12 16:19:48 -0400
commit46ee9c143211231d5d81840b28d1b869c0860aa7 (patch)
treea89256c01180d9d7d6478b2aff58941a67b3ef12 /drivers/net/ethernet/emulex
parentbdac85b55e57ca880147a4c6bd9f8af69507956a (diff)
be2net: fix pmac_id[] allocation size
The allocation size must be be_max_uc() and not "be_max_uc() + 1" Signed-off-by: Ravikumar Nelavelli <ravikumar.nelavelli@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/emulex')
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 2f02bcbf316..eaf08917f34 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -3314,9 +3314,8 @@ static int be_get_config(struct be_adapter *adapter)
if (status)
return status;
- /* primary mac needs 1 pmac entry */
- adapter->pmac_id = kcalloc(be_max_uc(adapter) + 1, sizeof(u32),
- GFP_KERNEL);
+ adapter->pmac_id = kcalloc(be_max_uc(adapter),
+ sizeof(*adapter->pmac_id), GFP_KERNEL);
if (!adapter->pmac_id)
return -ENOMEM;