2009-02-12 17:51:30

by Helmut Schaa

[permalink] [raw]
Subject: [PATCH] iwlagn: clean up error path in iwl_pci_probe

This avoids triggering a BUG_ON in pci_disable_msi in the error path.
Furthermore remove the first call to pci_disable_device as it is already
called at out_pci_disable_device.

Both issues were introduced in the patch "iwlagn: fix hw-rfkill while
the interface is down".

Signed-off-by: Helmut Schaa <[email protected]>
---

JFI iwl3945 is not affected.

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 397577c..87b237d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -3605,21 +3605,21 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)

err = request_irq(priv->pci_dev->irq, iwl_isr, IRQF_SHARED,
DRV_NAME, priv);
if (err) {
IWL_ERR(priv, "Error allocating IRQ %d\n", priv->pci_dev->irq);
goto out_disable_msi;
}
err = sysfs_create_group(&pdev->dev.kobj, &iwl_attribute_group);
if (err) {
IWL_ERR(priv, "failed to create sysfs device attributes\n");
- goto out_uninit_drv;
+ goto out_free_irq;
}

iwl_setup_deferred_work(priv);
iwl_setup_rx_handlers(priv);

/**********************************
* 9. Setup and register mac80211
**********************************/

/* enable interrupts if needed: hw bug w/a */
@@ -3650,24 +3650,24 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
IWL_ERR(priv, "Unable to initialize RFKILL system. "
"Ignoring error: %d\n", err);
else
iwl_rfkill_set_hw_state(priv);

iwl_power_initialize(priv);
return 0;

out_remove_sysfs:
sysfs_remove_group(&pdev->dev.kobj, &iwl_attribute_group);
+ out_free_irq:
+ free_irq(priv->pci_dev->irq, priv);
out_disable_msi:
pci_disable_msi(priv->pci_dev);
- pci_disable_device(priv->pci_dev);
- out_uninit_drv:
iwl_uninit_drv(priv);
out_free_eeprom:
iwl_eeprom_free(priv);
out_iounmap:
pci_iounmap(pdev, priv->hw_base);
out_pci_release_regions:
pci_release_regions(pdev);
pci_set_drvdata(pdev, NULL);
out_pci_disable_device:
pci_disable_device(pdev);


2009-02-12 18:37:04

by Reinette Chatre

[permalink] [raw]
Subject: Re: [PATCH] iwlagn: clean up error path in iwl_pci_probe

On Thu, 2009-02-12 at 09:51 -0800, Helmut Schaa wrote:
> This avoids triggering a BUG_ON in pci_disable_msi in the error path.
> Furthermore remove the first call to pci_disable_device as it is already
> called at out_pci_disable_device.
>
> Both issues were introduced in the patch "iwlagn: fix hw-rfkill while
> the interface is down".
>
> Signed-off-by: Helmut Schaa <[email protected]>
> ---

Thank you.

Acked-by: Reinette Chatre <[email protected]>

Reinette