Skip to content

Commit

Permalink
ntb_netdev: correct skb leak
Browse files Browse the repository at this point in the history
If ntb_netdev is unable to pass a new skb to the ntb transport for
future rx packets, it should free the newly alloc'ed skb in the error
case.  Found by Kernel memory leak detector.

Signed-off-by: Jon Mason <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Jon Mason authored and gregkh committed Jan 20, 2013
1 parent 19e17f7 commit 765ccc7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/ntb_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ static void ntb_netdev_rx_handler(struct ntb_transport_qp *qp, void *qp_data,

rc = ntb_transport_rx_enqueue(qp, skb, skb->data, ndev->mtu + ETH_HLEN);
if (rc) {
dev_kfree_skb(skb);
ndev->stats.rx_errors++;
ndev->stats.rx_fifo_errors++;
}
Expand Down

0 comments on commit 765ccc7

Please sign in to comment.