diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-05-05 20:49:01 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-05-14 08:00:21 -0400 |
commit | e37aab9c63b87dd4ece0b570d3886f7c6c03b549 (patch) | |
tree | 3fe76ee284c58e32908aefea335276d372b898d9 | |
parent | 8795ee7bed243c291d30830efe925966253aa2d6 (diff) |
bnxt_en: allocate enough space for ->ntp_fltr_bmap
[ Upstream commit ac45bd93a5035c2f39c9862b8b6ed692db0fdc87 ]
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 f08a20b921e7..48ee4110ef6e 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c | |||
@@ -2867,7 +2867,8 @@ static int bnxt_alloc_ntp_fltrs(struct bnxt *bp) | |||
2867 | INIT_HLIST_HEAD(&bp->ntp_fltr_hash_tbl[i]); | 2867 | INIT_HLIST_HEAD(&bp->ntp_fltr_hash_tbl[i]); |
2868 | 2868 | ||
2869 | bp->ntp_fltr_count = 0; | 2869 | bp->ntp_fltr_count = 0; |
2870 | bp->ntp_fltr_bmap = kzalloc(BITS_TO_LONGS(BNXT_NTP_FLTR_MAX_FLTR), | 2870 | bp->ntp_fltr_bmap = kcalloc(BITS_TO_LONGS(BNXT_NTP_FLTR_MAX_FLTR), |
2871 | sizeof(long), | ||
2871 | GFP_KERNEL); | 2872 | GFP_KERNEL); |
2872 | 2873 | ||
2873 | if (!bp->ntp_fltr_bmap) | 2874 | if (!bp->ntp_fltr_bmap) |