diff options
author | Brandeburg, Jesse <jesse.brandeburg@intel.com> | 2008-09-30 09:08:48 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-08 19:53:40 -0400 |
commit | 23e55a32ca1ffdbe7a492ef99f0e0ac48e504a13 (patch) | |
tree | 485f848f2270a5d0d1b167e3b5f9d34617979711 /drivers | |
parent | 1694f25b4beb80b911fb21efcff36acca39aa696 (diff) |
ixgb: fix bug when freeing resources
It was pointed out by Breno Leitao <leitao@linux.vnet.ibm.com> that
ixgb would crash on PPC when an IOMMU was in use, if change_mtu was
called.
It appears to be a pretty simple issue in the driver that wasn't discovered
because most systems don't run with an IOMMU. The driver needs to only unmap
buffers that are mapped (duh).
CC: Breno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ixgb/ixgb_main.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index aa75385cd6c7..be3c7dc96f63 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c | |||
@@ -977,15 +977,17 @@ ixgb_clean_rx_ring(struct ixgb_adapter *adapter) | |||
977 | 977 | ||
978 | for (i = 0; i < rx_ring->count; i++) { | 978 | for (i = 0; i < rx_ring->count; i++) { |
979 | buffer_info = &rx_ring->buffer_info[i]; | 979 | buffer_info = &rx_ring->buffer_info[i]; |
980 | if (buffer_info->skb) { | 980 | if (buffer_info->dma) { |
981 | |||
982 | pci_unmap_single(pdev, | 981 | pci_unmap_single(pdev, |
983 | buffer_info->dma, | 982 | buffer_info->dma, |
984 | buffer_info->length, | 983 | buffer_info->length, |
985 | PCI_DMA_FROMDEVICE); | 984 | PCI_DMA_FROMDEVICE); |
985 | buffer_info->dma = 0; | ||
986 | buffer_info->length = 0; | ||
987 | } | ||
986 | 988 | ||
989 | if (buffer_info->skb) { | ||
987 | dev_kfree_skb(buffer_info->skb); | 990 | dev_kfree_skb(buffer_info->skb); |
988 | |||
989 | buffer_info->skb = NULL; | 991 | buffer_info->skb = NULL; |
990 | } | 992 | } |
991 | } | 993 | } |