]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bnxt_en: allocate enough space for ->ntp_fltr_bmap
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 6 May 2017 00:49:01 +0000 (03:49 +0300)
committerSomasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Tue, 11 Jul 2017 00:04:09 +0000 (17:04 -0700)
Orabug: 264025332632559926366387

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>
(cherry picked from commit ac45bd93a5035c2f39c9862b8b6ed692db0fdc87)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index 2906f35a1a7b6448c68287ca5fee741ae41d21d0..611415daf683b24e5c61392eee65e42a8909280f 100644 (file)
@@ -3016,7 +3016,8 @@ static int bnxt_alloc_ntp_fltrs(struct bnxt *bp)
                INIT_HLIST_HEAD(&bp->ntp_fltr_hash_tbl[i]);
 
        bp->ntp_fltr_count = 0;
-       bp->ntp_fltr_bmap = kzalloc(BITS_TO_LONGS(BNXT_NTP_FLTR_MAX_FLTR),
+       bp->ntp_fltr_bmap = kcalloc(BITS_TO_LONGS(BNXT_NTP_FLTR_MAX_FLTR),
+                                   sizeof(long),
                                    GFP_KERNEL);
 
        if (!bp->ntp_fltr_bmap)