diff options
author | Ravikumar Nelavelli <ravikumar.nelavelli@emulex.com> | 2014-03-11 18:53:06 +0530 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-03-12 16:19:48 -0400 |
commit | 46ee9c143211231d5d81840b28d1b869c0860aa7 (patch) | |
tree | a89256c01180d9d7d6478b2aff58941a67b3ef12 /drivers/net/ethernet/emulex | |
parent | bdac85b55e57ca880147a4c6bd9f8af69507956a (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.c | 5 |
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 2f02bcbf3164..eaf08917f341 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; |