All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: sun: fix missing release regions in cas_init_one().
@ 2020-05-22 21:50 wu000273
  2020-05-22 23:20 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: wu000273 @ 2020-05-22 21:50 UTC (permalink / raw)
  To: davem
  Cc: kuba, hkallweit1, jonathan.lemon, netdev, linux-kernel, kjlu, wu000273

From: Qiushi Wu <wu000273@umn.edu>

In cas_init_one(), "pdev" is requested by "pci_request_regions", but it
was not released after a call of the function “pci_write_config_byte” 
failed. Thus replace the jump target “err_write_cacheline” by 
"err_out_free_res".

Fixes: 1f26dac32057 ("[NET]: Add Sun Cassini driver.")
Signed-off-by: Qiushi Wu <wu000273@umn.edu>
---
 drivers/net/ethernet/sun/cassini.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/sun/cassini.c b/drivers/net/ethernet/sun/cassini.c
index e6d1aa882fa5..f1c8615ab6f0 100644
--- a/drivers/net/ethernet/sun/cassini.c
+++ b/drivers/net/ethernet/sun/cassini.c
@@ -4963,7 +4963,7 @@ static int cas_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 					  cas_cacheline_size)) {
 			dev_err(&pdev->dev, "Could not set PCI cache "
 			       "line size\n");
-			goto err_write_cacheline;
+			goto err_out_free_res;
 		}
 	}
 #endif
@@ -5136,7 +5136,6 @@ static int cas_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 err_out_free_res:
 	pci_release_regions(pdev);
 
-err_write_cacheline:
 	/* Try to restore it in case the error occurred after we
 	 * set it.
 	 */
-- 
2.17.1


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

* Re: [PATCH] net: sun: fix missing release regions in cas_init_one().
  2020-05-22 21:50 [PATCH] net: sun: fix missing release regions in cas_init_one() wu000273
@ 2020-05-22 23:20 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-05-22 23:20 UTC (permalink / raw)
  To: wu000273; +Cc: kuba, hkallweit1, jonathan.lemon, netdev, linux-kernel, kjlu

From: wu000273@umn.edu
Date: Fri, 22 May 2020 16:50:27 -0500

> From: Qiushi Wu <wu000273@umn.edu>
> 
> In cas_init_one(), "pdev" is requested by "pci_request_regions", but it
> was not released after a call of the function “pci_write_config_byte” 
> failed. Thus replace the jump target “err_write_cacheline” by 
> "err_out_free_res".
> 
> Fixes: 1f26dac32057 ("[NET]: Add Sun Cassini driver.")
> Signed-off-by: Qiushi Wu <wu000273@umn.edu>

Applied, thank you.

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

end of thread, other threads:[~2020-05-22 23:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-22 21:50 [PATCH] net: sun: fix missing release regions in cas_init_one() wu000273
2020-05-22 23:20 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.