From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Cc: Intel Linux Wireless <ilw@linux.intel.com>,
Emmanuel Grumbach <emmanuel.grumbach@intel.com>,
linux-wireless@vger.kernel.org,
Stanislaw Gruszka <sgruszka@redhat.com>
Subject: [PATCH] iwlagn: fix rmmod crash
Date: Fri, 24 Jun 2011 11:34:34 +0200 [thread overview]
Message-ID: <1308908074-4163-1-git-send-email-sgruszka@redhat.com> (raw)
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
next reply other threads:[~2011-06-24 9:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-24 9:34 Stanislaw Gruszka [this message]
2011-06-24 10:42 ` [PATCH] iwlagn: fix rmmod crash Emmanuel Grumbach
2011-06-24 14:02 ` wwguy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1308908074-4163-1-git-send-email-sgruszka@redhat.com \
--to=sgruszka@redhat.com \
--cc=emmanuel.grumbach@intel.com \
--cc=ilw@linux.intel.com \
--cc=linux-wireless@vger.kernel.org \
--cc=wey-yi.w.guy@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox