linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iwlagn: clean up error path in iwl_pci_probe
@ 2009-02-12 17:51 Helmut Schaa
  2009-02-12 18:40 ` reinette chatre
  0 siblings, 1 reply; 2+ messages in thread
From: Helmut Schaa @ 2009-02-12 17:51 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, reinette.chatre

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 <helmut.schaa@googlemail.com>
---

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);

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

* Re: [PATCH] iwlagn: clean up error path in iwl_pci_probe
  2009-02-12 17:51 [PATCH] iwlagn: clean up error path in iwl_pci_probe Helmut Schaa
@ 2009-02-12 18:40 ` reinette chatre
  0 siblings, 0 replies; 2+ messages in thread
From: reinette chatre @ 2009-02-12 18:40 UTC (permalink / raw)
  To: Helmut Schaa; +Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org

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 <helmut.schaa@googlemail.com>
> ---

Thank you.

Acked-by: Reinette Chatre <reinette.chatre@intel.com>

Reinette


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

end of thread, other threads:[~2009-02-12 18:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-12 17:51 [PATCH] iwlagn: clean up error path in iwl_pci_probe Helmut Schaa
2009-02-12 18:40 ` reinette chatre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).