* [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
* Re: [PATCH] iwlagn: fix rmmod crash
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
1 sibling, 0 replies; 3+ messages in thread
From: Emmanuel Grumbach @ 2011-06-24 10:42 UTC (permalink / raw)
To: Stanislaw Gruszka
Cc: Wey-Yi Guy, Intel Linux Wireless, Emmanuel Grumbach,
linux-wireless
On Fri, Jun 24, 2011 at 12:34, Stanislaw Gruszka <sgruszka@redhat.com> wrote:
> 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.
Oops... You are definitely right. Strangely enough, I was very lucky
when I run the 500 cycles of rmmod insmod.
Thanks for the fix !
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iwlagn: fix rmmod crash
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
1 sibling, 0 replies; 3+ messages in thread
From: wwguy @ 2011-06-24 14:02 UTC (permalink / raw)
To: Stanislaw Gruszka
Cc: Intel Linux Wireless, Grumbach, Emmanuel,
linux-wireless@vger.kernel.org
On Fri, 2011-06-24 at 02:34 -0700, Stanislaw Gruszka wrote:
> 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>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
> ---
you are right, thank you very much for catch this.
Wey
^ permalink raw reply [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