Skip to content

Commit

Permalink
intel/i40e: delete if NULL check before dev_kfree_skb
Browse files Browse the repository at this point in the history
dev_kfree_skb check if the input parameter NULL and do the right
thing, there is no need to check again.
This change is to cleanup the code a bit.

Signed-off-by: Bernard Zhao <zhaojunkui2008@126.com>
Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
  • Loading branch information
Bernard Zhao authored and Tony Nguyen committed Jun 21, 2022
1 parent 3e0fcb7 commit 56878d4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/ethernet/intel/i40e/i40e_txrx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1483,10 +1483,8 @@ void i40e_clean_rx_ring(struct i40e_ring *rx_ring)
if (!rx_ring->rx_bi)
return;

if (rx_ring->skb) {
dev_kfree_skb(rx_ring->skb);
rx_ring->skb = NULL;
}
dev_kfree_skb(rx_ring->skb);
rx_ring->skb = NULL;

if (rx_ring->xsk_pool) {
i40e_xsk_clean_rx_ring(rx_ring);
Expand Down

0 comments on commit 56878d4

Please sign in to comment.