summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/orinoco/orinoco_pci.c
diff options
context:
space:
mode:
authorJes Sorensen <Jes.Sorensen@redhat.com>2015-08-06 12:46:31 -0400
committerKalle Valo <kvalo@codeaurora.org>2015-08-13 15:36:47 +0300
commit94fdc2e627d1b479a117cd8b9ece5f4613a5c956 (patch)
tree125033af6b6efbc00aa7c8c8b59a7479586d2416 /drivers/net/wireless/orinoco/orinoco_pci.c
parentcb9d61e5304e2880180e4ccf685a298c868094e0 (diff)
orinoco: Do not call wiphy_unregister() from free_orinocodev()
alloc_orinocodev() would allocate the wiphy entry, but it would only get registered much later in orinoco_init(). If something failed in the init process inbetween the call to alloc_orinocodev() and the completion of orinoco_init(), the drivers would end up calling wiphy_unregister() with a NULL pointer causing beautiful OOPS fireworks. Explicitly call wiphy_unregister() instead in the right places. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/orinoco/orinoco_pci.c')
-rw-r--r--drivers/net/wireless/orinoco/orinoco_pci.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/orinoco/orinoco_pci.c b/drivers/net/wireless/orinoco/orinoco_pci.c
index 74219d59d7e1..4938a2208a37 100644
--- a/drivers/net/wireless/orinoco/orinoco_pci.c
+++ b/drivers/net/wireless/orinoco/orinoco_pci.c
@@ -173,13 +173,15 @@ static int orinoco_pci_init_one(struct pci_dev *pdev,
err = orinoco_if_add(priv, 0, 0, NULL);
if (err) {
printk(KERN_ERR PFX "orinoco_if_add() failed\n");
- goto fail;
+ goto fail_wiphy;
}
pci_set_drvdata(pdev, priv);
return 0;
+ fail_wiphy:
+ wiphy_unregister(priv_to_wiphy(priv));
fail:
free_irq(pdev->irq, priv);
@@ -203,6 +205,7 @@ static void orinoco_pci_remove_one(struct pci_dev *pdev)
struct orinoco_private *priv = pci_get_drvdata(pdev);
orinoco_if_del(priv);
+ wiphy_unregister(priv_to_wiphy(priv));
free_irq(pdev->irq, priv);
free_orinocodev(priv);
pci_iounmap(pdev, priv->hw.iobase);