Skip to content

Commit 9456239

Browse files
Dan Carpentergregkh
authored andcommitted
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: c0c050c ("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>
1 parent 5c333f8 commit 9456239

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • drivers/net/ethernet/broadcom/bnxt

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2473,7 +2473,8 @@ static int bnxt_alloc_ntp_fltrs(struct bnxt *bp)
24732473
INIT_HLIST_HEAD(&bp->ntp_fltr_hash_tbl[i]);
24742474

24752475
bp->ntp_fltr_count = 0;
2476-
bp->ntp_fltr_bmap = kzalloc(BITS_TO_LONGS(BNXT_NTP_FLTR_MAX_FLTR),
2476+
bp->ntp_fltr_bmap = kcalloc(BITS_TO_LONGS(BNXT_NTP_FLTR_MAX_FLTR),
2477+
sizeof(long),
24772478
GFP_KERNEL);
24782479

24792480
if (!bp->ntp_fltr_bmap)

0 commit comments

Comments
 (0)