Skip to content

Commit

Permalink
iwlagn: fix rmmod crash
Browse files Browse the repository at this point in the history
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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Stanislaw Gruszka authored and John W. Linville committed Jun 27, 2011
1 parent 1d616b1 commit 428bc8c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/net/wireless/iwlwifi/iwl-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 428bc8c

Please sign in to comment.