summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Mason <jon.mason@intel.com>2013-11-22 16:50:57 -0700
committerJon Mason <jon.mason@intel.com>2014-04-07 10:58:14 -0700
commite8bc2ebdceea3c0c6de16d899f0679654c308739 (patch)
treeff32b932c5e70791c9f23544ece0c2de10700ee9
parentfea903ecd799ec49a2ebc4cc8cfb7bb96fd31ddc (diff)
downloadtalos-obmc-linux-e8bc2ebdceea3c0c6de16d899f0679654c308739.tar.gz
talos-obmc-linux-e8bc2ebdceea3c0c6de16d899f0679654c308739.zip
ntb_netdev: Fix skb free issue in open
In ntb_netdev_open, when ntb_transport_rx_enqueue fails the skb that was attempting to be enqueued is not freed. Free this skb on the ntb_transport_rx_enqueue error. Signed-off-by: Jon Mason <jon.mason@intel.com>
-rw-r--r--drivers/net/ntb_netdev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ntb_netdev.c b/drivers/net/ntb_netdev.c
index 8298880bfdd8..8e6752fd89ac 100644
--- a/drivers/net/ntb_netdev.c
+++ b/drivers/net/ntb_netdev.c
@@ -182,8 +182,10 @@ static int ntb_netdev_open(struct net_device *ndev)
rc = ntb_transport_rx_enqueue(dev->qp, skb, skb->data,
ndev->mtu + ETH_HLEN);
- if (rc == -EINVAL)
+ if (rc == -EINVAL) {
+ dev_kfree_skb(skb);
goto err;
+ }
}
netif_carrier_off(ndev);
OpenPOWER on IntegriCloud