Skip to content

Commit

Permalink
netxen: fix infinite loop on dma mapping failure
Browse files Browse the repository at this point in the history
Fix a perpetual while() loop in unwinding partial
mapped tx skb on dma mapping failure.

Reported-by: "Juha Leppanen" <juha_motorsportcom@luukku.com>
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dhananjay Phadke authored and David S. Miller committed Sep 4, 2009
1 parent 270e57e commit cf503e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/netxen/netxen_nic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1577,8 +1577,8 @@ netxen_map_tx_skb(struct pci_dev *pdev,
return 0;

unwind:
while (i > 0) {
nf = &pbuf->frag_array[i];
while (--i >= 0) {
nf = &pbuf->frag_array[i+1];
pci_unmap_page(pdev, nf->dma, nf->length, PCI_DMA_TODEVICE);
}

Expand Down

0 comments on commit cf503e8

Please sign in to comment.