Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e8bc2ebd authored by Jon Mason's avatar Jon Mason
Browse files

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: default avatarJon Mason <jon.mason@intel.com>
parent fea903ec
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -182,9 +182,11 @@ 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);
	ntb_transport_link_up(dev->qp);