From: Jon Mason Date: Sat, 19 Jan 2013 09:02:31 +0000 (-0700) Subject: ntb_netdev: correct skb leak X-Git-Tag: v3.12-rc1~1403^2~42 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=765ccc7bc3d913e18b887a86de1e86db701a2d78;p=kernel%2Fkernel-generic.git ntb_netdev: correct skb leak 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/ntb_netdev.c b/drivers/net/ntb_netdev.c index 0d4a6ee..28d6fea 100644 --- a/drivers/net/ntb_netdev.c +++ b/drivers/net/ntb_netdev.c @@ -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++; }