]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ixgb: move time stamp set before setting dma pointer
authorJesse Brandeburg <jesse.brandeburg@intel.com>
Tue, 8 Jul 2008 22:51:37 +0000 (15:51 -0700)
committerJeff Garzik <jgarzik@redhat.com>
Fri, 11 Jul 2008 05:20:27 +0000 (01:20 -0400)
a user pointed out that setting variables out of order with respect
to the checks we make for tx timeout handling could result in a race
where ->dma was set but ->time_stamp was set to the old value.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/net/ixgb/ixgb_main.c

index 0e72dadf8b70b94004a2db512a0ffe13403e7c7a..4bf6bbc6582250659578dcf8b4eb941cbae2519a 100644 (file)
@@ -1290,12 +1290,12 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb,
 
                buffer_info->length = size;
                WARN_ON(buffer_info->dma != 0);
+               buffer_info->time_stamp = jiffies;
                buffer_info->dma =
                        pci_map_single(adapter->pdev,
                                skb->data + offset,
                                size,
                                PCI_DMA_TODEVICE);
-               buffer_info->time_stamp = jiffies;
                buffer_info->next_to_watch = 0;
 
                len -= size;
@@ -1322,13 +1322,13 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb,
                                size -= 4;
 
                        buffer_info->length = size;
+                       buffer_info->time_stamp = jiffies;
                        buffer_info->dma =
                                pci_map_page(adapter->pdev,
                                        frag->page,
                                        frag->page_offset + offset,
                                        size,
                                        PCI_DMA_TODEVICE);
-                       buffer_info->time_stamp = jiffies;
                        buffer_info->next_to_watch = 0;
 
                        len -= size;