Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] iwlagn: fix rmmod crash
@ 2011-06-24  9:34 Stanislaw Gruszka
  2011-06-24 10:42 ` Emmanuel Grumbach
  2011-06-24 14:02 ` wwguy
  0 siblings, 2 replies; 3+ messages in thread
From: Stanislaw Gruszka @ 2011-06-24  9:34 UTC (permalink / raw)
  To: Wey-Yi Guy
  Cc: Intel Linux Wireless, Emmanuel Grumbach, linux-wireless,
	Stanislaw Gruszka

priv->bus.bus_specific pointer is used after priv structures was freed,
in iwl_pci_remove(), what make ugly rmmod crash. This bug was introduced
by current pci changes.

On the way remove fake check, if prober error code is returned from
.probe() function, .remove() will never be called be null drvdata.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/wireless/iwlwifi/iwl-pci.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c b/drivers/net/wireless/iwlwifi/iwl-pci.c
index 7328fbf..55a04b8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-pci.c
+++ b/drivers/net/wireless/iwlwifi/iwl-pci.c
@@ -496,14 +496,11 @@ static void iwl_pci_down(void *bus)
 static void __devexit iwl_pci_remove(struct pci_dev *pdev)
 {
 	struct iwl_priv *priv = pci_get_drvdata(pdev);
-
-	/* This can happen if probe failed */
-	if (unlikely(!priv))
-		return;
+	void *bus_specific = priv->bus.bus_specific;
 
 	iwl_remove(priv);
 
-	iwl_pci_down(IWL_BUS_GET_PCI_BUS(&priv->bus));
+	iwl_pci_down(bus_specific);
 }
 
 #ifdef CONFIG_PM
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-06-24 14:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-24  9:34 [PATCH] iwlagn: fix rmmod crash Stanislaw Gruszka
2011-06-24 10:42 ` Emmanuel Grumbach
2011-06-24 14:02 ` wwguy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox