aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBrice Goglin <brice@myri.com>2009-01-17 03:27:19 -0500
committerDavid S. Miller <davem@davemloft.net>2009-01-20 17:41:18 -0500
commite3fd553468738e0342cbd82a63ede00c983a0eb4 (patch)
tree7cfa7e5a0bceb4c77ad00ed4accf75743e8a323f /drivers
parent357f5b0b91054ae23385ea4b0634bb8b43736e83 (diff)
myri10ge: don't forget pci_disable_device()
Don't forget to call pci_disable_device() in myri10ge_remove() and when myri10ge_probe() fails. By the way, update the copyright years. Signed-off-by: Brice Goglin <brice@myri.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/myri10ge/myri10ge.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index 6bb71b687f7b..e9c1296b267e 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -1,7 +1,7 @@
1/************************************************************************* 1/*************************************************************************
2 * myri10ge.c: Myricom Myri-10G Ethernet driver. 2 * myri10ge.c: Myricom Myri-10G Ethernet driver.
3 * 3 *
4 * Copyright (C) 2005 - 2007 Myricom, Inc. 4 * Copyright (C) 2005 - 2009 Myricom, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
@@ -75,7 +75,7 @@
75#include "myri10ge_mcp.h" 75#include "myri10ge_mcp.h"
76#include "myri10ge_mcp_gen_header.h" 76#include "myri10ge_mcp_gen_header.h"
77 77
78#define MYRI10GE_VERSION_STR "1.4.4-1.398" 78#define MYRI10GE_VERSION_STR "1.4.4-1.401"
79 79
80MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); 80MODULE_DESCRIPTION("Myricom 10G driver (10GbE)");
81MODULE_AUTHOR("Maintainer: help@myri.com"); 81MODULE_AUTHOR("Maintainer: help@myri.com");
@@ -3786,7 +3786,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3786 if (status != 0) { 3786 if (status != 0) {
3787 dev_err(&pdev->dev, "Error %d writing PCI_EXP_DEVCTL\n", 3787 dev_err(&pdev->dev, "Error %d writing PCI_EXP_DEVCTL\n",
3788 status); 3788 status);
3789 goto abort_with_netdev; 3789 goto abort_with_enabled;
3790 } 3790 }
3791 3791
3792 pci_set_master(pdev); 3792 pci_set_master(pdev);
@@ -3801,13 +3801,13 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3801 } 3801 }
3802 if (status != 0) { 3802 if (status != 0) {
3803 dev_err(&pdev->dev, "Error %d setting DMA mask\n", status); 3803 dev_err(&pdev->dev, "Error %d setting DMA mask\n", status);
3804 goto abort_with_netdev; 3804 goto abort_with_enabled;
3805 } 3805 }
3806 (void)pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK); 3806 (void)pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
3807 mgp->cmd = dma_alloc_coherent(&pdev->dev, sizeof(*mgp->cmd), 3807 mgp->cmd = dma_alloc_coherent(&pdev->dev, sizeof(*mgp->cmd),
3808 &mgp->cmd_bus, GFP_KERNEL); 3808 &mgp->cmd_bus, GFP_KERNEL);
3809 if (mgp->cmd == NULL) 3809 if (mgp->cmd == NULL)
3810 goto abort_with_netdev; 3810 goto abort_with_enabled;
3811 3811
3812 mgp->board_span = pci_resource_len(pdev, 0); 3812 mgp->board_span = pci_resource_len(pdev, 0);
3813 mgp->iomem_base = pci_resource_start(pdev, 0); 3813 mgp->iomem_base = pci_resource_start(pdev, 0);
@@ -3943,8 +3943,10 @@ abort_with_mtrr:
3943 dma_free_coherent(&pdev->dev, sizeof(*mgp->cmd), 3943 dma_free_coherent(&pdev->dev, sizeof(*mgp->cmd),
3944 mgp->cmd, mgp->cmd_bus); 3944 mgp->cmd, mgp->cmd_bus);
3945 3945
3946abort_with_netdev: 3946abort_with_enabled:
3947 pci_disable_device(pdev);
3947 3948
3949abort_with_netdev:
3948 free_netdev(netdev); 3950 free_netdev(netdev);
3949 return status; 3951 return status;
3950} 3952}
@@ -3990,6 +3992,7 @@ static void myri10ge_remove(struct pci_dev *pdev)
3990 mgp->cmd, mgp->cmd_bus); 3992 mgp->cmd, mgp->cmd_bus);
3991 3993
3992 free_netdev(netdev); 3994 free_netdev(netdev);
3995 pci_disable_device(pdev);
3993 pci_set_drvdata(pdev, NULL); 3996 pci_set_drvdata(pdev, NULL);
3994} 3997}
3995 3998