mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 10:57:46 +00:00
ntb_netdev: correct skb leak
If ntb_netdev is unable to pass a new skb to the ntb transport for future rx packets, it should free the newly alloc'ed skb in the error case. Found by Kernel memory leak detector. Signed-off-by: Jon Mason <jon.mason@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
19e17f7248
commit
765ccc7bc3
1 changed files with 1 additions and 0 deletions
|
@ -119,6 +119,7 @@ static void ntb_netdev_rx_handler(struct ntb_transport_qp *qp, void *qp_data,
|
|||
|
||||
rc = ntb_transport_rx_enqueue(qp, skb, skb->data, ndev->mtu + ETH_HLEN);
|
||||
if (rc) {
|
||||
dev_kfree_skb(skb);
|
||||
ndev->stats.rx_errors++;
|
||||
ndev->stats.rx_fifo_errors++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue