Skip to content

Commit

Permalink
net/bnx2x: fix memory leak
Browse files Browse the repository at this point in the history
[ upstream commit 0cf8fdc ]

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

Fixes: 540a211 ("bnx2x: driver core")

Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
  • Loading branch information
Shahed Shaikh authored and kevintraynor committed Jun 24, 2019
1 parent a4c0a5b commit fee77da
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/bnx2x/bnx2x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

}
Expand Down

0 comments on commit fee77da

Please sign in to comment.