[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1396918374-5196-3-git-send-email-jon.mason@intel.com>
Date: Mon, 7 Apr 2014 17:52:47 -0700
From: Jon Mason <jon.mason@...el.com>
To: linux-kernel@...r.kernel.org
Subject: [PATCH 2/9] 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@...el.com>
---
drivers/net/ntb_netdev.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ntb_netdev.c b/drivers/net/ntb_netdev.c
index 8298880..8e6752f 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);
--
1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists