summaryrefslogtreecommitdiffstats
path: root/drivers/net/ntb_netdev.c
diff options
context:
space:
mode:
authorJon Mason <jon.mason@intel.com>2013-01-19 02:02:31 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-20 15:48:13 -0800
commit765ccc7bc3d913e18b887a86de1e86db701a2d78 (patch)
treedcb913f3ba15bab0afd6dedbc29c9b9dbcb97b0b /drivers/net/ntb_netdev.c
parent19e17f7248e8ef72a8b625db7ddd99c0ad3da27c (diff)
downloadlinux-765ccc7bc3d913e18b887a86de1e86db701a2d78.tar.bz2
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 <jon.mason@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/ntb_netdev.c')
-rw-r--r--drivers/net/ntb_netdev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ntb_netdev.c b/drivers/net/ntb_netdev.c
index 0d4a6ee5a7f0..28d6fea54384 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++;
}