From: Jon Mason Date: Fri, 22 Nov 2013 23:50:57 +0000 (-0700) Subject: ntb_netdev: Fix skb free issue in open X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e8bc2ebdceea3c0c6de16d899f0679654c308739;p=linux-beck.git 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 --- 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);