All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] bnxt_en: allocate enough space for ->ntp_fltr_bmap
@ 2017-05-06  0:49 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2017-05-06  0:49 UTC (permalink / raw)
  To: Michael Chan; +Cc: netdev, kernel-janitors

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>

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)
 		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)

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net] bnxt_en: allocate enough space for ->ntp_fltr_bmap
@ 2017-05-06  0:49 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2017-05-06  0:49 UTC (permalink / raw)
  To: Michael Chan; +Cc: netdev, kernel-janitors

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>

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)
 		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)

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] bnxt_en: allocate enough space for ->ntp_fltr_bmap
  2017-05-06  0:49 ` Dan Carpenter
@ 2017-05-06  1:04   ` Michael Chan
  -1 siblings, 0 replies; 4+ messages in thread
From: Michael Chan @ 2017-05-06  1:04 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Netdev, kernel-janitors

On Fri, May 5, 2017 at 5:49 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 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>

David, please send this to -stable as well.  Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] bnxt_en: allocate enough space for ->ntp_fltr_bmap
@ 2017-05-06  1:04   ` Michael Chan
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Chan @ 2017-05-06  1:04 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Netdev, kernel-janitors

On Fri, May 5, 2017 at 5:49 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 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>

David, please send this to -stable as well.  Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-05-06  1:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-06  0:49 [PATCH net] bnxt_en: allocate enough space for ->ntp_fltr_bmap Dan Carpenter
2017-05-06  0:49 ` Dan Carpenter
2017-05-06  1:04 ` Michael Chan
2017-05-06  1:04   ` Michael Chan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.