be2net: fix pmac_id[] allocation size
authorRavikumar Nelavelli <ravikumar.nelavelli@emulex.com>
Tue, 11 Mar 2014 13:23:06 +0000 (18:53 +0530)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 Mar 2014 20:19:48 +0000 (16:19 -0400)
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>
drivers/net/ethernet/emulex/benet/be_main.c

index 2f02bcbf31643e3c4e34acb4f061da5914a27d90..eaf08917f34199c17f87e79ba80f0d32d2cc65b9 100644 (file)
@@ -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;