All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: mvpp2: fix memory leak in mvpp2_rx
@ 2020-07-31  8:38 Lorenzo Bianconi
  2020-07-31  9:38 ` Matteo Croce
  2020-08-03 22:15 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Lorenzo Bianconi @ 2020-07-31  8:38 UTC (permalink / raw)
  To: netdev; +Cc: davem, lorenzo.bianconi, mw, mcroce

Release skb memory in mvpp2_rx() if mvpp2_rx_refill routine fails

Fixes: b5015854674b ("net: mvpp2: fix refilling BM pools in RX path")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index 24f4d8e0da98..ee72397813d4 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -2981,6 +2981,7 @@ static int mvpp2_rx(struct mvpp2_port *port, struct napi_struct *napi,
 		err = mvpp2_rx_refill(port, bm_pool, pool);
 		if (err) {
 			netdev_err(port->dev, "failed to refill BM pools\n");
+			dev_kfree_skb_any(skb);
 			goto err_drop_frame;
 		}
 
-- 
2.26.2


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

* Re: [PATCH net] net: mvpp2: fix memory leak in mvpp2_rx
  2020-07-31  8:38 [PATCH net] net: mvpp2: fix memory leak in mvpp2_rx Lorenzo Bianconi
@ 2020-07-31  9:38 ` Matteo Croce
  2020-08-03 22:15 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Matteo Croce @ 2020-07-31  9:38 UTC (permalink / raw)
  To: Lorenzo Bianconi, netdev; +Cc: davem, lorenzo.bianconi, mw

> Release skb memory in mvpp2_rx() if mvpp2_rx_refill routine fails
> 
> Fixes: b5015854674b ("net: mvpp2: fix refilling BM pools in RX path")
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>

I think that mvpp2_rx() has changed a bit in net-next due to the XDP support, but it should apply too.

Acked-by: Matteo Croce <mcroce@microsoft.com>

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

* Re: [PATCH net] net: mvpp2: fix memory leak in mvpp2_rx
  2020-07-31  8:38 [PATCH net] net: mvpp2: fix memory leak in mvpp2_rx Lorenzo Bianconi
  2020-07-31  9:38 ` Matteo Croce
@ 2020-08-03 22:15 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-08-03 22:15 UTC (permalink / raw)
  To: lorenzo; +Cc: netdev, lorenzo.bianconi, mw, mcroce

From: Lorenzo Bianconi <lorenzo@kernel.org>
Date: Fri, 31 Jul 2020 10:38:32 +0200

> Release skb memory in mvpp2_rx() if mvpp2_rx_refill routine fails
> 
> Fixes: b5015854674b ("net: mvpp2: fix refilling BM pools in RX path")
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>

Applied and queued up for -stable, thank you.

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

end of thread, other threads:[~2020-08-03 22:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-31  8:38 [PATCH net] net: mvpp2: fix memory leak in mvpp2_rx Lorenzo Bianconi
2020-07-31  9:38 ` Matteo Croce
2020-08-03 22:15 ` David Miller

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.