Skip to contentSkip to conversation

iwlagn: clean up error path in iwl_pci_probe

PATCH In review Helmut Schaa 2 participants 2 messages Feb 12, 2009 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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".

---

JFI iwl3945 is not affected.

drivers/net/wireless/iwlwifi/iwl-agn.c +3 -3
index 397577c..87b237d 100644
@@ -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);
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Helmut Schaa

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".

---

Thank you.

Reinette