lkml.org 
[lkml]   [2013]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 17/21] ntb_netdev: correct skb leak
Date
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>
---
drivers/net/ntb_netdev.c | 1 +
1 file changed, 1 insertion(+)

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++;
}
--
1.7.9.5


\
 
 \ /
  Last update: 2013-01-19 10:41    [W:0.174 / U:1.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site