Patchwork [2/3] pch_can: fix rmmod issue

login
register
mail settings
Submitter Tomoya
Date Feb. 8, 2011, 9:29 a.m.
Message ID <1297157343-3213-2-git-send-email-tomoya-linux@dsn.okisemi.com>
Download mbox | patch
Permalink /patch/82266/
State Accepted
Delegated to: David Miller
Headers show

Comments

Tomoya - Feb. 8, 2011, 9:29 a.m.
Currently, when rmmod pch_can, kernel failure occurs.
The cause is pci_iounmap executed before pch_can_reset.
Thus pci_iounmap moves after pch_can_reset.

Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
---
 drivers/net/can/pch_can.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
David Miller - Feb. 9, 2011, 12:37 a.m.
From: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Date: Tue,  8 Feb 2011 18:29:02 +0900

> Currently, when rmmod pch_can, kernel failure occurs.
> The cause is pci_iounmap executed before pch_can_reset.
> Thus pci_iounmap moves after pch_can_reset.
> 
> Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c
index 9b171d1..342d514 100644
--- a/drivers/net/can/pch_can.c
+++ b/drivers/net/can/pch_can.c
@@ -959,13 +959,13 @@  static void __devexit pch_can_remove(struct pci_dev *pdev)
 	struct pch_can_priv *priv = netdev_priv(ndev);
 
 	unregister_candev(priv->ndev);
-	pci_iounmap(pdev, priv->regs);
 	if (priv->use_msi)
 		pci_disable_msi(priv->dev);
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
 	pci_set_drvdata(pdev, NULL);
 	pch_can_reset(priv);
+	pci_iounmap(pdev, priv->regs);
 	free_candev(priv->ndev);
 }