nvethernet: Free skb for Rx error packets

Issue: Driver does not free skb if OSI_PKT_CX_VALID is reset for Rx
       error packets. It can cause memory leak.
Fix: Free Rx packet skb's for error packets

Bug 2906694

Change-Id: I4364cf9d2974334d2b2d76bfcc22ef89ac406e8c
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2338963
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Mahesh Patil
2020-05-04 16:02:35 -07:00
committed by Revanth Kumar Uppala
parent 96c5478e05
commit d7e0d58393

View File

@@ -289,6 +289,7 @@ void osd_receive_packet(void *priv, void *rxring, unsigned int chan,
ndev->stats.rx_frame_errors = pkt_err_stat->rx_frame_error; ndev->stats.rx_frame_errors = pkt_err_stat->rx_frame_error;
ndev->stats.rx_fifo_errors = osi_core->mmc.mmc_rx_fifo_overflow; ndev->stats.rx_fifo_errors = osi_core->mmc.mmc_rx_fifo_overflow;
ndev->stats.rx_errors++; ndev->stats.rx_errors++;
dev_kfree_skb_any(skb);
} }
ndev->stats.rx_packets++; ndev->stats.rx_packets++;