All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: aquantia: Fix an error handling path in 'aq_pci_probe()'
@ 2018-05-08  6:39 ` Christophe JAILLET
  0 siblings, 0 replies; 8+ messages in thread
From: Christophe JAILLET @ 2018-05-08  6:39 UTC (permalink / raw)
  To: davem, igor.russkikh, pavel.belous, weiyongjun1, dan.carpenter
  Cc: netdev, linux-kernel, kernel-janitors, Christophe JAILLET

The position of 2 labels should be swapped in order to release resources
in the correct order and avoid leaks.

Fixes: 23ee07ad3c2f ("net: aquantia: Cleanup pci functions module")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
The order of 'pci_release_regions()' and 'free_netdev()' is in reverse
order in the 'aq_pci_remove()' function.
I don't know if done on purpose and/or needed, so I've left it as-is.
---
 drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c
index ecc6306f940f..b7f6b5a68b33 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c
@@ -298,9 +298,9 @@ static int aq_pci_probe(struct pci_dev *pdev,
 	kfree(self->aq_hw);
 err_ioremap:
 	free_netdev(ndev);
-err_pci_func:
-	pci_release_regions(pdev);
 err_ndev:
+	pci_release_regions(pdev);
+err_pci_func:
 	pci_disable_device(pdev);
 	return err;
 }
-- 
2.17.0

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

* [PATCH] net: aquantia: Fix an error handling path in 'aq_pci_probe()'
@ 2018-05-08  6:39 ` Christophe JAILLET
  0 siblings, 0 replies; 8+ messages in thread
From: Christophe JAILLET @ 2018-05-08  6:39 UTC (permalink / raw)
  To: davem, igor.russkikh, pavel.belous, weiyongjun1, dan.carpenter
  Cc: netdev, linux-kernel, kernel-janitors, Christophe JAILLET

The position of 2 labels should be swapped in order to release resources
in the correct order and avoid leaks.

Fixes: 23ee07ad3c2f ("net: aquantia: Cleanup pci functions module")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
The order of 'pci_release_regions()' and 'free_netdev()' is in reverse
order in the 'aq_pci_remove()' function.
I don't know if done on purpose and/or needed, so I've left it as-is.
---
 drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c
index ecc6306f940f..b7f6b5a68b33 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c
@@ -298,9 +298,9 @@ static int aq_pci_probe(struct pci_dev *pdev,
 	kfree(self->aq_hw);
 err_ioremap:
 	free_netdev(ndev);
-err_pci_func:
-	pci_release_regions(pdev);
 err_ndev:
+	pci_release_regions(pdev);
+err_pci_func:
 	pci_disable_device(pdev);
 	return err;
 }
-- 
2.17.0


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

* Re: [PATCH] net: aquantia: Fix an error handling path in 'aq_pci_probe()'
  2018-05-08  6:39 ` Christophe JAILLET
@ 2018-05-08  7:19   ` Igor Russkikh
  -1 siblings, 0 replies; 8+ messages in thread
From: Igor Russkikh @ 2018-05-08  7:19 UTC (permalink / raw)
  To: Christophe JAILLET, davem, pavel.belous, weiyongjun1, dan.carpenter
  Cc: netdev, linux-kernel, kernel-janitors

Hi Christophe,

On 08.05.2018 09:39, Christophe JAILLET wrote:
> The position of 2 labels should be swapped in order to release resources
> in the correct order and avoid leaks.
> 

>  	kfree(self->aq_hw);
>  err_ioremap:
>  	free_netdev(ndev);
> -err_pci_func:
> -	pci_release_regions(pdev);
>  err_ndev:
> +	pci_release_regions(pdev);
> +err_pci_func:
>  	pci_disable_device(pdev);
>  	return err;
>  }
> 

This was just submitted yesterday and is already accepted in netdev by David:

http://patchwork.ozlabs.org/patch/909746/

Thanks!

BR, Igor

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

* Re: [PATCH] net: aquantia: Fix an error handling path in 'aq_pci_probe()'
@ 2018-05-08  7:19   ` Igor Russkikh
  0 siblings, 0 replies; 8+ messages in thread
From: Igor Russkikh @ 2018-05-08  7:19 UTC (permalink / raw)
  To: Christophe JAILLET, davem, pavel.belous, weiyongjun1, dan.carpenter
  Cc: netdev, linux-kernel, kernel-janitors

Hi Christophe,

On 08.05.2018 09:39, Christophe JAILLET wrote:
> The position of 2 labels should be swapped in order to release resources
> in the correct order and avoid leaks.
> 

>  	kfree(self->aq_hw);
>  err_ioremap:
>  	free_netdev(ndev);
> -err_pci_func:
> -	pci_release_regions(pdev);
>  err_ndev:
> +	pci_release_regions(pdev);
> +err_pci_func:
>  	pci_disable_device(pdev);
>  	return err;
>  }
> 

This was just submitted yesterday and is already accepted in netdev by David:

http://patchwork.ozlabs.org/patch/909746/

Thanks!

BR, Igor

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

* Re: [PATCH] net: aquantia: Fix an error handling path in 'aq_pci_probe()'
  2018-05-08  7:19   ` Igor Russkikh
@ 2018-05-10 14:38     ` Christophe JAILLET
  -1 siblings, 0 replies; 8+ messages in thread
From: Christophe JAILLET @ 2018-05-10 14:38 UTC (permalink / raw)
  To: Igor Russkikh, davem, pavel.belous, weiyongjun1, dan.carpenter
  Cc: netdev, linux-kernel, kernel-janitors

Le 08/05/2018 à 09:19, Igor Russkikh a écrit :
>
> This was just submitted yesterday and is already accepted in netdev by David:
>
> http://patchwork.ozlabs.org/patch/909746/
>
> Thanks!
>
> BR, Igor
>
Patch timing is sometimes surprising!

Not sure at all if it can be an issue, but I also noted that the order 
of 'pci_release_regions()' and 'free_netdev()' is in reverse
order in the 'aq_pci_remove()' function.
I don't know if done on purpose and/or needed, so I've left it as-is.

CJ

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

* Re: [PATCH] net: aquantia: Fix an error handling path in 'aq_pci_probe()'
@ 2018-05-10 14:38     ` Christophe JAILLET
  0 siblings, 0 replies; 8+ messages in thread
From: Christophe JAILLET @ 2018-05-10 14:38 UTC (permalink / raw)
  To: Igor Russkikh, davem, pavel.belous, weiyongjun1, dan.carpenter
  Cc: netdev, linux-kernel, kernel-janitors

Le 08/05/2018 à 09:19, Igor Russkikh a écrit :
>
> This was just submitted yesterday and is already accepted in netdev by David:
>
> http://patchwork.ozlabs.org/patch/909746/
>
> Thanks!
>
> BR, Igor
>
Patch timing is sometimes surprising!

Not sure at all if it can be an issue, but I also noted that the order 
of 'pci_release_regions()' and 'free_netdev()' is in reverse
order in the 'aq_pci_remove()' function.
I don't know if done on purpose and/or needed, so I've left it as-is.

CJ


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

* Re: [PATCH] net: aquantia: Fix an error handling path in 'aq_pci_probe()'
  2018-05-10 14:38     ` Christophe JAILLET
@ 2018-05-10 15:25       ` Igor Russkikh
  -1 siblings, 0 replies; 8+ messages in thread
From: Igor Russkikh @ 2018-05-10 15:25 UTC (permalink / raw)
  To: Christophe JAILLET, davem, pavel.belous, weiyongjun1, dan.carpenter
  Cc: netdev, linux-kernel, kernel-janitors


> Patch timing is sometimes surprising!

Indeed it.

> 
> Not sure at all if it can be an issue, but I also noted that the order of 'pci_release_regions()' and 'free_netdev()' is in reverse
> order in the 'aq_pci_remove()' function.
> I don't know if done on purpose and/or needed, so I've left it as-is.

I think the order is not important here, so believe thats merely a cosmetics.

BR, Igor

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

* Re: [PATCH] net: aquantia: Fix an error handling path in 'aq_pci_probe()'
@ 2018-05-10 15:25       ` Igor Russkikh
  0 siblings, 0 replies; 8+ messages in thread
From: Igor Russkikh @ 2018-05-10 15:25 UTC (permalink / raw)
  To: Christophe JAILLET, davem, pavel.belous, weiyongjun1, dan.carpenter
  Cc: netdev, linux-kernel, kernel-janitors


> Patch timing is sometimes surprising!

Indeed it.

> 
> Not sure at all if it can be an issue, but I also noted that the order of 'pci_release_regions()' and 'free_netdev()' is in reverse
> order in the 'aq_pci_remove()' function.
> I don't know if done on purpose and/or needed, so I've left it as-is.

I think the order is not important here, so believe thats merely a cosmetics.

BR, Igor

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

end of thread, other threads:[~2018-05-10 15:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-08  6:39 [PATCH] net: aquantia: Fix an error handling path in 'aq_pci_probe()' Christophe JAILLET
2018-05-08  6:39 ` Christophe JAILLET
2018-05-08  7:19 ` Igor Russkikh
2018-05-08  7:19   ` Igor Russkikh
2018-05-10 14:38   ` Christophe JAILLET
2018-05-10 14:38     ` Christophe JAILLET
2018-05-10 15:25     ` Igor Russkikh
2018-05-10 15:25       ` Igor Russkikh

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.