dect
/
linux-2.6
Archived
13
0
Fork 0

dect: coa: fix oops on module unload

Copy sc1442x_base to a local variable to unmap it since we have to
free the transceiver that contains the pointer before that.

Additionally (in case of the PCMCIA driver) call pcmcia_disable_device()
before freeing the transceiver since we may still receive interrupts until
that point.

Signed-off- by: Patrick McHardy <kaber@gtrash.net>ZZ
This commit is contained in:
Patrick McHardy 2011-04-06 21:32:38 +02:00
parent 2e21102c9c
commit a8d83344b0
2 changed files with 4 additions and 2 deletions

View File

@ -163,11 +163,12 @@ static void com_on_air_remove(struct pcmcia_device *link)
{
struct dect_transceiver *trx = link->priv;
struct coa_device *dev = dect_transceiver_priv(trx);
u8 __iomem *sc1442x_base = dev->sc1442x_base;
sc1442x_shutdown_device(dev);
iounmap(dev->sc1442x_base);
pcmcia_disable_device(link);
dect_unregister_transceiver(trx);
iounmap(sc1442x_base);
}
static int com_on_air_suspend(struct pcmcia_device *link)

View File

@ -104,11 +104,12 @@ static void __devexit coa_remove(struct pci_dev *pdev)
{
struct dect_transceiver *trx = pci_get_drvdata(pdev);
struct coa_device *dev = dect_transceiver_priv(trx);
u8 __iomem *sc1442x_base = dev->sc1442x_base;
sc1442x_shutdown_device(dev);
free_irq(pdev->irq, trx);
dect_unregister_transceiver(trx);
iounmap(dev->sc1442x_base);
iounmap(sc1442x_base);
pci_release_regions(pdev);
pci_disable_device(pdev);
}