Skip to content

Commit

Permalink
caif-hsi: Free flip_buffer at shutdown
Browse files Browse the repository at this point in the history
Fix memory leak of RX flip-buffer.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
sjur.brandeland@stericsson.com authored and David S. Miller committed Apr 13, 2012
1 parent 5c699fb commit 5f614e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/caif/caif_hsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,7 @@ int cfhsi_probe(struct platform_device *pdev)

static void cfhsi_shutdown(struct cfhsi *cfhsi)
{
u8 *tx_buf, *rx_buf;
u8 *tx_buf, *rx_buf, *flip_buf;

/* Stop TXing */
netif_tx_stop_all_queues(cfhsi->ndev);
Expand All @@ -1234,7 +1234,7 @@ static void cfhsi_shutdown(struct cfhsi *cfhsi)
/* Store bufferes: will be freed later. */
tx_buf = cfhsi->tx_buf;
rx_buf = cfhsi->rx_buf;

flip_buf = cfhsi->rx_flip_buf;
/* Flush transmit queues. */
cfhsi_abort_tx(cfhsi);

Expand All @@ -1247,6 +1247,7 @@ static void cfhsi_shutdown(struct cfhsi *cfhsi)
/* Free buffers. */
kfree(tx_buf);
kfree(rx_buf);
kfree(flip_buf);
}

int cfhsi_remove(struct platform_device *pdev)
Expand Down

0 comments on commit 5f614e6

Please sign in to comment.