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:
parent
2e21102c9c
commit
a8d83344b0
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Reference in New Issue