Skip to content

Commit

Permalink
myri10ge: don't forget pci_disable_device()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Brice Goglin authored and David S. Miller committed Jan 20, 2009
1 parent 357f5b0 commit e3fd553
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions drivers/net/myri10ge/myri10ge.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*************************************************************************
* myri10ge.c: Myricom Myri-10G Ethernet driver.
*
* Copyright (C) 2005 - 2007 Myricom, Inc.
* Copyright (C) 2005 - 2009 Myricom, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -75,7 +75,7 @@
#include "myri10ge_mcp.h"
#include "myri10ge_mcp_gen_header.h"

#define MYRI10GE_VERSION_STR "1.4.4-1.398"
#define MYRI10GE_VERSION_STR "1.4.4-1.401"

MODULE_DESCRIPTION("Myricom 10G driver (10GbE)");
MODULE_AUTHOR("Maintainer: help@myri.com");
Expand Down Expand Up @@ -3786,7 +3786,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (status != 0) {
dev_err(&pdev->dev, "Error %d writing PCI_EXP_DEVCTL\n",
status);
goto abort_with_netdev;
goto abort_with_enabled;
}

pci_set_master(pdev);
Expand All @@ -3801,13 +3801,13 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
}
if (status != 0) {
dev_err(&pdev->dev, "Error %d setting DMA mask\n", status);
goto abort_with_netdev;
goto abort_with_enabled;
}
(void)pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
mgp->cmd = dma_alloc_coherent(&pdev->dev, sizeof(*mgp->cmd),
&mgp->cmd_bus, GFP_KERNEL);
if (mgp->cmd == NULL)
goto abort_with_netdev;
goto abort_with_enabled;

mgp->board_span = pci_resource_len(pdev, 0);
mgp->iomem_base = pci_resource_start(pdev, 0);
Expand Down Expand Up @@ -3943,8 +3943,10 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
dma_free_coherent(&pdev->dev, sizeof(*mgp->cmd),
mgp->cmd, mgp->cmd_bus);

abort_with_netdev:
abort_with_enabled:
pci_disable_device(pdev);

abort_with_netdev:
free_netdev(netdev);
return status;
}
Expand Down Expand Up @@ -3990,6 +3992,7 @@ static void myri10ge_remove(struct pci_dev *pdev)
mgp->cmd, mgp->cmd_bus);

free_netdev(netdev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
}

Expand Down

0 comments on commit e3fd553

Please sign in to comment.