netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipw2100: inproper error handling of ipw2100_pci_init_one
@ 2021-12-28  9:34 Peiwei Hu
  2022-02-01 12:15 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Peiwei Hu @ 2021-12-28  9:34 UTC (permalink / raw)
  To: stas.yakovlev, kvalo, davem, kuba
  Cc: linux-wireless, netdev, linux-kernel, trivial, Peiwei Hu

goto fail instead of returning directly in error exiting

Signed-off-by: Peiwei Hu <jlu.hpw@foxmail.com>
---
 drivers/net/wireless/intel/ipw2x00/ipw2100.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2100.c b/drivers/net/wireless/intel/ipw2x00/ipw2100.c
index 2ace2b27ecad..de043edc0521 100644
--- a/drivers/net/wireless/intel/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/intel/ipw2x00/ipw2100.c
@@ -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
-- 
2.25.1


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

* Re: [PATCH] ipw2100: inproper error handling of ipw2100_pci_init_one
  2021-12-28  9:34 [PATCH] ipw2100: inproper error handling of ipw2100_pci_init_one Peiwei Hu
@ 2022-02-01 12:15 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2022-02-01 12:15 UTC (permalink / raw)
  To: Peiwei Hu
  Cc: stas.yakovlev, kvalo, davem, kuba, linux-wireless, netdev,
	linux-kernel, trivial, Peiwei Hu

Peiwei Hu <jlu.hpw@foxmail.com> wrote:

> goto fail instead of returning directly in error exiting
> 
> Signed-off-by: Peiwei Hu <jlu.hpw@foxmail.com>

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.

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/tencent_205AA371C910BBA2CF01B311811ABDF2560A@qq.com/

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


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

end of thread, other threads:[~2022-02-01 12:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-28  9:34 [PATCH] ipw2100: inproper error handling of ipw2100_pci_init_one Peiwei Hu
2022-02-01 12:15 ` Kalle Valo

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