diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-05-05 20:49:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-05-08 14:47:31 -0400 |
commit | ac45bd93a5035c2f39c9862b8b6ed692db0fdc87 (patch) | |
tree | f610646749017ed71acfb859e0721038ec28d09e | |
parent | df5303a8aa9a0a6934f4cea7427f1edf771f21c2 (diff) |
bnxt_en: allocate enough space for ->ntp_fltr_bmap
We have the number of longs, but we need to calculate the number of
bytes required.
Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index b3ba66032980..b56c54d68d5e 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c | |||
@@ -3000,7 +3000,8 @@ static int bnxt_alloc_ntp_fltrs(struct bnxt *bp) | |||
3000 | INIT_HLIST_HEAD(&bp->ntp_fltr_hash_tbl[i]); | 3000 | INIT_HLIST_HEAD(&bp->ntp_fltr_hash_tbl[i]); |
3001 | 3001 | ||
3002 | bp->ntp_fltr_count = 0; | 3002 | bp->ntp_fltr_count = 0; |
3003 | bp->ntp_fltr_bmap = kzalloc(BITS_TO_LONGS(BNXT_NTP_FLTR_MAX_FLTR), | 3003 | bp->ntp_fltr_bmap = kcalloc(BITS_TO_LONGS(BNXT_NTP_FLTR_MAX_FLTR), |
3004 | sizeof(long), | ||
3004 | GFP_KERNEL); | 3005 | GFP_KERNEL); |
3005 | 3006 | ||
3006 | if (!bp->ntp_fltr_bmap) | 3007 | if (!bp->ntp_fltr_bmap) |