aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/hostap/hostap_cs.c5
-rw-r--r--drivers/net/wireless/hostap/hostap_pci.c9
-rw-r--r--drivers/net/wireless/hostap/hostap_plx.c7
3 files changed, 7 insertions, 14 deletions
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
index 23bcc51b7131..2643976a6677 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -565,13 +565,14 @@ static void prism2_detach(dev_link_t *link)
565 *linkp = link->next; 565 *linkp = link->next;
566 /* release net devices */ 566 /* release net devices */
567 if (link->priv) { 567 if (link->priv) {
568 struct hostap_cs_priv *hw_priv;
568 struct net_device *dev; 569 struct net_device *dev;
569 struct hostap_interface *iface; 570 struct hostap_interface *iface;
570 dev = link->priv; 571 dev = link->priv;
571 iface = netdev_priv(dev); 572 iface = netdev_priv(dev);
572 kfree(iface->local->hw_priv); 573 hw_priv = iface->local->hw_priv;
573 iface->local->hw_priv = NULL;
574 prism2_free_local_data(dev); 574 prism2_free_local_data(dev);
575 kfree(hw_priv);
575 } 576 }
576 kfree(link); 577 kfree(link);
577} 578}
diff --git a/drivers/net/wireless/hostap/hostap_pci.c b/drivers/net/wireless/hostap/hostap_pci.c
index 0d7305dfa690..da0c80fb941c 100644
--- a/drivers/net/wireless/hostap/hostap_pci.c
+++ b/drivers/net/wireless/hostap/hostap_pci.c
@@ -358,8 +358,6 @@ static int prism2_pci_probe(struct pci_dev *pdev,
358 return hostap_hw_ready(dev); 358 return hostap_hw_ready(dev);
359 359
360 fail: 360 fail:
361 kfree(hw_priv);
362
363 if (irq_registered && dev) 361 if (irq_registered && dev)
364 free_irq(dev->irq, dev); 362 free_irq(dev->irq, dev);
365 363
@@ -370,10 +368,8 @@ static int prism2_pci_probe(struct pci_dev *pdev,
370 368
371 err_out_disable: 369 err_out_disable:
372 pci_disable_device(pdev); 370 pci_disable_device(pdev);
373 kfree(hw_priv);
374 if (local)
375 local->hw_priv = NULL;
376 prism2_free_local_data(dev); 371 prism2_free_local_data(dev);
372 kfree(hw_priv);
377 373
378 return -ENODEV; 374 return -ENODEV;
379} 375}
@@ -398,9 +394,8 @@ static void prism2_pci_remove(struct pci_dev *pdev)
398 free_irq(dev->irq, dev); 394 free_irq(dev->irq, dev);
399 395
400 mem_start = hw_priv->mem_start; 396 mem_start = hw_priv->mem_start;
401 kfree(hw_priv);
402 iface->local->hw_priv = NULL;
403 prism2_free_local_data(dev); 397 prism2_free_local_data(dev);
398 kfree(hw_priv);
404 399
405 iounmap(mem_start); 400 iounmap(mem_start);
406 401
diff --git a/drivers/net/wireless/hostap/hostap_plx.c b/drivers/net/wireless/hostap/hostap_plx.c
index 85d3f8a29539..78d67b408b2f 100644
--- a/drivers/net/wireless/hostap/hostap_plx.c
+++ b/drivers/net/wireless/hostap/hostap_plx.c
@@ -568,10 +568,8 @@ static int prism2_plx_probe(struct pci_dev *pdev,
568 return hostap_hw_ready(dev); 568 return hostap_hw_ready(dev);
569 569
570 fail: 570 fail:
571 kfree(hw_priv);
572 if (local)
573 local->hw_priv = NULL;
574 prism2_free_local_data(dev); 571 prism2_free_local_data(dev);
572 kfree(hw_priv);
575 573
576 if (irq_registered && dev) 574 if (irq_registered && dev)
577 free_irq(dev->irq, dev); 575 free_irq(dev->irq, dev);
@@ -604,9 +602,8 @@ static void prism2_plx_remove(struct pci_dev *pdev)
604 if (dev->irq) 602 if (dev->irq)
605 free_irq(dev->irq, dev); 603 free_irq(dev->irq, dev);
606 604
607 kfree(iface->local->hw_priv);
608 iface->local->hw_priv = NULL;
609 prism2_free_local_data(dev); 605 prism2_free_local_data(dev);
606 kfree(hw_priv);
610 pci_disable_device(pdev); 607 pci_disable_device(pdev);
611} 608}
612 609