netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] qede: allocate enough data for ->arfs_fltr_bmap
@ 2017-04-19  9:54 Dan Carpenter
  2017-04-19 10:12 ` Mintz, Yuval
  2017-04-20 20:25 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2017-04-19  9:54 UTC (permalink / raw)
  To: Yuval Mintz, Chopra, Manish
  Cc: Ariel Elior, everest-linux-l2, netdev, kernel-janitors

We've got the number of longs, yes, but we should multiply by
sizeof(long) to get the number of bytes needed.

Fixes: e4917d46a653 ("qede: Add aRFS support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Btw, this driver use vmalloc() all over the place but kmalloc() is more
appropriate when you're allocating tiny ammounts.

diff --git a/drivers/net/ethernet/qlogic/qede/qede_filter.c b/drivers/net/ethernet/qlogic/qede/qede_filter.c
index 8c594a3ca63b..34473fbac798 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_filter.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_filter.c
@@ -267,7 +267,8 @@ int qede_alloc_arfs(struct qede_dev *edev)
 		return -ENOMEM;
 	}
 
-	edev->arfs->arfs_fltr_bmap = vzalloc(BITS_TO_LONGS(QEDE_RFS_MAX_FLTR));
+	edev->arfs->arfs_fltr_bmap = vzalloc(BITS_TO_LONGS(QEDE_RFS_MAX_FLTR) *
+					     sizeof(long));
 	if (!edev->arfs->arfs_fltr_bmap) {
 		free_irq_cpu_rmap(edev->ndev->rx_cpu_rmap);
 		edev->ndev->rx_cpu_rmap = NULL;

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

* RE: [PATCH net-next] qede: allocate enough data for ->arfs_fltr_bmap
  2017-04-19  9:54 [PATCH net-next] qede: allocate enough data for ->arfs_fltr_bmap Dan Carpenter
@ 2017-04-19 10:12 ` Mintz, Yuval
  2017-04-20 20:25 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Mintz, Yuval @ 2017-04-19 10:12 UTC (permalink / raw)
  To: Dan Carpenter, Chopra, Manish
  Cc: Elior, Ariel, netdev@vger.kernel.org,
	kernel-janitors@vger.kernel.org, Chopra@mwanda

> We've got the number of longs, yes, but we should multiply by
> sizeof(long) to get the number of bytes needed.
> 
> Fixes: e4917d46a653 ("qede: Add aRFS support")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks Dan.

Acked-by: Yuval Mintz <Yuval.Mintz@cavium.com>

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

* Re: [PATCH net-next] qede: allocate enough data for ->arfs_fltr_bmap
  2017-04-19  9:54 [PATCH net-next] qede: allocate enough data for ->arfs_fltr_bmap Dan Carpenter
  2017-04-19 10:12 ` Mintz, Yuval
@ 2017-04-20 20:25 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-04-20 20:25 UTC (permalink / raw)
  To: dan.carpenter
  Cc: Yuval.Mintz, Chopra, Manish.Chopra, Ariel.Elior, everest-linux-l2,
	netdev, kernel-janitors

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 19 Apr 2017 12:54:33 +0300

> We've got the number of longs, yes, but we should multiply by
> sizeof(long) to get the number of bytes needed.
> 
> Fixes: e4917d46a653 ("qede: Add aRFS support")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, thanks.

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

end of thread, other threads:[~2017-04-20 20:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-19  9:54 [PATCH net-next] qede: allocate enough data for ->arfs_fltr_bmap Dan Carpenter
2017-04-19 10:12 ` Mintz, Yuval
2017-04-20 20:25 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).