Browse Source

igb: Fix TX map failure path

When the driver cannot map a TX buffer, instead of rolling back
gracefully and retrying later, we currently get a panic:

[  159.885994] igb 0000:00:00.0: TX DMA map failed
[  159.886588] Unable to handle kernel paging request at virtual address ffff00000a08c7a8
               ...
[  159.897031] PC is at igb_xmit_frame_ring+0x9c8/0xcb8

Fix the erroneous test that leads to this situation.

Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jean-Philippe Brucker 7 years ago
parent
commit
104ba83363
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/net/ethernet/intel/igb/igb_main.c

+ 1 - 1
drivers/net/ethernet/intel/igb/igb_main.c

@@ -5326,7 +5326,7 @@ dma_error:
 				       DMA_TO_DEVICE);
 				       DMA_TO_DEVICE);
 		dma_unmap_len_set(tx_buffer, len, 0);
 		dma_unmap_len_set(tx_buffer, len, 0);
 
 
-		if (i--)
+		if (i-- == 0)
 			i += tx_ring->count;
 			i += tx_ring->count;
 		tx_buffer = &tx_ring->tx_buffer_info[i];
 		tx_buffer = &tx_ring->tx_buffer_info[i];
 	}
 	}