diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2007-08-02 14:21:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-08-03 18:10:44 -0400 |
commit | 3e847423bf029c2170692c75580a856debed617b (patch) | |
tree | a15dd1eb342470a4acd0376a38574b6b25dfd56c /drivers/net/s2io.c | |
parent | c73d83473e47415e943c398e6612f65f6da5b3c9 (diff) |
fix s2io regression
* wrong argument passed to pci_unmap_single() on failure
exit paths
* leak in the same area
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/net/s2io.c')
-rw-r--r-- | drivers/net/s2io.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 2be0a0f1b48f..24feb00600ee 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -2430,7 +2430,7 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no) | |||
2430 | (rxdp3->Buffer1_ptr == DMA_ERROR_CODE)) { | 2430 | (rxdp3->Buffer1_ptr == DMA_ERROR_CODE)) { |
2431 | pci_unmap_single | 2431 | pci_unmap_single |
2432 | (nic->pdev, | 2432 | (nic->pdev, |
2433 | (dma_addr_t)skb->data, | 2433 | (dma_addr_t)rxdp3->Buffer2_ptr, |
2434 | dev->mtu + 4, | 2434 | dev->mtu + 4, |
2435 | PCI_DMA_FROMDEVICE); | 2435 | PCI_DMA_FROMDEVICE); |
2436 | goto pci_map_failed; | 2436 | goto pci_map_failed; |
@@ -6211,7 +6211,7 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp, | |||
6211 | if( (rxdp3->Buffer0_ptr == 0) || | 6211 | if( (rxdp3->Buffer0_ptr == 0) || |
6212 | (rxdp3->Buffer0_ptr == DMA_ERROR_CODE)) { | 6212 | (rxdp3->Buffer0_ptr == DMA_ERROR_CODE)) { |
6213 | pci_unmap_single (sp->pdev, | 6213 | pci_unmap_single (sp->pdev, |
6214 | (dma_addr_t)(*skb)->data, | 6214 | (dma_addr_t)rxdp3->Buffer2_ptr, |
6215 | dev->mtu + 4, PCI_DMA_FROMDEVICE); | 6215 | dev->mtu + 4, PCI_DMA_FROMDEVICE); |
6216 | goto memalloc_failed; | 6216 | goto memalloc_failed; |
6217 | } | 6217 | } |
@@ -6224,7 +6224,10 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp, | |||
6224 | if( (rxdp3->Buffer1_ptr == 0) || | 6224 | if( (rxdp3->Buffer1_ptr == 0) || |
6225 | (rxdp3->Buffer1_ptr == DMA_ERROR_CODE)) { | 6225 | (rxdp3->Buffer1_ptr == DMA_ERROR_CODE)) { |
6226 | pci_unmap_single (sp->pdev, | 6226 | pci_unmap_single (sp->pdev, |
6227 | (dma_addr_t)(*skb)->data, | 6227 | (dma_addr_t)rxdp3->Buffer0_ptr, |
6228 | BUF0_LEN, PCI_DMA_FROMDEVICE); | ||
6229 | pci_unmap_single (sp->pdev, | ||
6230 | (dma_addr_t)rxdp3->Buffer2_ptr, | ||
6228 | dev->mtu + 4, PCI_DMA_FROMDEVICE); | 6231 | dev->mtu + 4, PCI_DMA_FROMDEVICE); |
6229 | goto memalloc_failed; | 6232 | goto memalloc_failed; |
6230 | } | 6233 | } |