From: Ravikumar Nelavelli Date: Tue, 11 Mar 2014 13:23:06 +0000 (+0530) Subject: be2net: fix pmac_id[] allocation size X-Git-Tag: v3.15-rc1~113^2~166 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=46ee9c143211231d5d81840b28d1b869c0860aa7;p=linux.git 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 Signed-off-by: Sathya Perla Signed-off-by: David S. Miller --- 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;