瀏覽代碼

Merge branch 'e1000'

Jeff Garzik 19 年之前
父節點
當前提交
ff7eba15ae
共有 1 個文件被更改,包括 13 次插入3 次删除
  1. 13 3
      drivers/net/e1000/e1000_ethtool.c

+ 13 - 3
drivers/net/e1000/e1000_ethtool.c

@@ -960,13 +960,21 @@ e1000_free_desc_rings(struct e1000_adapter *adapter)
 		}
 		}
 	}
 	}
 
 
-	if(txdr->desc)
+	if(txdr->desc) {
 		pci_free_consistent(pdev, txdr->size, txdr->desc, txdr->dma);
 		pci_free_consistent(pdev, txdr->size, txdr->desc, txdr->dma);
-	if(rxdr->desc)
+		txdr->desc = NULL;
+	}
+	if(rxdr->desc) {
 		pci_free_consistent(pdev, rxdr->size, rxdr->desc, rxdr->dma);
 		pci_free_consistent(pdev, rxdr->size, rxdr->desc, rxdr->dma);
+		rxdr->desc = NULL;
+	}
 
 
 	kfree(txdr->buffer_info);
 	kfree(txdr->buffer_info);
+	txdr->buffer_info = NULL;
+
 	kfree(rxdr->buffer_info);
 	kfree(rxdr->buffer_info);
+	rxdr->buffer_info = NULL;
+
 	return;
 	return;
 }
 }
 
 
@@ -1440,9 +1448,11 @@ static int
 e1000_loopback_test(struct e1000_adapter *adapter, uint64_t *data)
 e1000_loopback_test(struct e1000_adapter *adapter, uint64_t *data)
 {
 {
 	if((*data = e1000_setup_desc_rings(adapter))) goto err_loopback;
 	if((*data = e1000_setup_desc_rings(adapter))) goto err_loopback;
-	if((*data = e1000_setup_loopback_test(adapter))) goto err_loopback;
+	if((*data = e1000_setup_loopback_test(adapter)))
+		goto err_loopback_setup;
 	*data = e1000_run_loopback_test(adapter);
 	*data = e1000_run_loopback_test(adapter);
 	e1000_loopback_cleanup(adapter);
 	e1000_loopback_cleanup(adapter);
+err_loopback_setup:
 	e1000_free_desc_rings(adapter);
 	e1000_free_desc_rings(adapter);
 err_loopback:
 err_loopback:
 	return *data;
 	return *data;