提交 e8bc2ebd 编写于 作者: J Jon Mason

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: NJon Mason <jon.mason@intel.com>
上级 fea903ec
...@@ -182,8 +182,10 @@ static int ntb_netdev_open(struct net_device *ndev) ...@@ -182,8 +182,10 @@ static int ntb_netdev_open(struct net_device *ndev)
rc = ntb_transport_rx_enqueue(dev->qp, skb, skb->data, rc = ntb_transport_rx_enqueue(dev->qp, skb, skb->data,
ndev->mtu + ETH_HLEN); ndev->mtu + ETH_HLEN);
if (rc == -EINVAL) if (rc == -EINVAL) {
dev_kfree_skb(skb);
goto err; goto err;
}
} }
netif_carrier_off(ndev); netif_carrier_off(ndev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册