Skip to contentSkip to conversation

ipw2100: inproper error handling of ipw2100_pci_init_one

PATCH In review Peiwei Hu 2 participants 2 messages Dec 28, 2021 – Feb 1, 2022

Subsystems (3)
lore
Share & tools
lore

Peiwei Hu

author
#0 lore raw

PATCH 1/1 ipw2100: inproper error handling of ipw2100_pci_init_one

goto fail instead of returning directly in error exiting

---
 drivers/net/wireless/intel/ipw2x00/ipw2100.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/intel/ipw2x00/ipw2100.c +3 -3
index 2ace2b27ecad..de043edc0521 100644
@@ -6183,7 +6183,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
 	if (err) {
 		printk(KERN_WARNING DRV_NAME
 		       "Error calling pci_enable_device.\n");
-		return err;
+		goto fail;
 	}
 
 	priv = libipw_priv(dev);
@@ -6196,7 +6196,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
 		printk(KERN_WARNING DRV_NAME
 		       "Error calling pci_set_dma_mask.\n");
 		pci_disable_device(pci_dev);
-		return err;
+		goto fail;
 	}
 
 	err = pci_request_regions(pci_dev, DRV_NAME);
@@ -6204,7 +6204,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
 		printk(KERN_WARNING DRV_NAME
 		       "Error calling pci_request_regions.\n");
 		pci_disable_device(pci_dev);
-		return err;
+		goto fail;
 	}
 
 	/* We disable the RETRY_TIMEOUT register (0x41) to keep
Signature · 1 line
2.25.1
#1 lore raw
Quoted 3 lines · Peiwei Hu

goto fail instead of returning directly in error exiting

The commit log does not answer to "why?". Also looking at ipw2100_pci_init_one() I think it would need more cleanup in error handling, for example pci_ionumap() is called in different order etc.

Patch set to Changes Requested.

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches