[dpdk-dev] [PATCH 3/5] net/bnx2x: fix memory leak

Shahed Shaikh shshaikh at marvell.com
Tue Jun 4 20:53:50 CEST 2019


bnx2x_free_hsi_mem() does not free DMA memory.
Fix it here.

Fixes: 540a211084a7 ("bnx2x: driver core")
Cc: stable at dpdk.org

Signed-off-by: Shahed Shaikh <shshaikh at marvell.com>
---
 drivers/net/bnx2x/bnx2x.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index e9f05a73a..d3b260830 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -9018,36 +9018,42 @@ void bnx2x_free_hsi_mem(struct bnx2x_softc *sc)
 /*******************/
 
 		memset(&fp->status_block, 0, sizeof(fp->status_block));
+		bnx2x_dma_free(&fp->sb_dma);
 	}
 
 	/***************************/
 	/* FW DECOMPRESSION BUFFER */
 	/***************************/
 
+	bnx2x_dma_free(&sc->gz_buf_dma);
 	sc->gz_buf = NULL;
 
 	/*******************/
 	/* SLOW PATH QUEUE */
 	/*******************/
 
+	bnx2x_dma_free(&sc->spq_dma);
 	sc->spq = NULL;
 
 	/*************/
 	/* SLOW PATH */
 	/*************/
 
+	bnx2x_dma_free(&sc->sp_dma);
 	sc->sp = NULL;
 
 	/***************/
 	/* EVENT QUEUE */
 	/***************/
 
+	bnx2x_dma_free(&sc->eq_dma);
 	sc->eq = NULL;
 
 	/************************/
 	/* DEFAULT STATUS BLOCK */
 	/************************/
 
+	bnx2x_dma_free(&sc->def_sb_dma);
 	sc->def_sb = NULL;
 
 }
-- 
2.12.3



More information about the dev mailing list