[PATCH net v3] net: ti: icssg-prueth: Add missing icss_iep_put to error path

Jan Kiszka posted 1 patch 2 years, 1 month ago
There is a newer version of this series
drivers/net/ethernet/ti/icssg/icssg_prueth.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
[PATCH net v3] net: ti: icssg-prueth: Add missing icss_iep_put to error path
Posted by Jan Kiszka 2 years, 1 month ago
From: Jan Kiszka <jan.kiszka@siemens.com>

Analogously to prueth_remove, just also taking care for NULL'ing the
iep pointers.

Fixes: 186734c15886 ("net: ti: icssg-prueth: add packet timestamping and ptp support")
Fixes: 443a2367ba3c ("net: ti: icssg-prueth: am65x SR2.0 add 10M full duplex support")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

Changes in v3:
 - consolidate cleanup logic further [Wojciech]
 - make sure to NULL iep pointers

Changes in v2:
 - add proper tags

This was lost from the TI SDK version while ripping out SR1.0 support - which we are currently restoring for upstream.

 drivers/net/ethernet/ti/icssg/icssg_prueth.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
index 6c4b64227ac8..3abbeba26f1b 100644
--- a/drivers/net/ethernet/ti/icssg/icssg_prueth.c
+++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
@@ -2105,10 +2105,7 @@ static int prueth_probe(struct platform_device *pdev)
 	prueth->iep1 = icss_iep_get_idx(np, 1);
 	if (IS_ERR(prueth->iep1)) {
 		ret = dev_err_probe(dev, PTR_ERR(prueth->iep1), "iep1 get failed\n");
-		icss_iep_put(prueth->iep0);
-		prueth->iep0 = NULL;
-		prueth->iep1 = NULL;
-		goto free_pool;
+		goto put_iep0;
 	}
 
 	if (prueth->pdata.quirk_10m_link_issue) {
@@ -2205,6 +2202,12 @@ static int prueth_probe(struct platform_device *pdev)
 exit_iep:
 	if (prueth->pdata.quirk_10m_link_issue)
 		icss_iep_exit_fw(prueth->iep1);
+	icss_iep_put(prueth->iep1);
+
+put_iep0:
+	icss_iep_put(prueth->iep0);
+	prueth->iep0 = NULL;
+	prueth->iep1 = NULL;
 
 free_pool:
 	gen_pool_free(prueth->sram_pool,
-- 
2.35.3
Re: [PATCH net v3] net: ti: icssg-prueth: Add missing icss_iep_put to error path
Posted by Jakub Kicinski 2 years, 1 month ago
On Mon, 6 Nov 2023 12:47:42 +0100 Jan Kiszka wrote:
> Analogously to prueth_remove, just also taking care for NULL'ing the
> iep pointers.
> 
> Fixes: 186734c15886 ("net: ti: icssg-prueth: add packet timestamping and ptp support")
> Fixes: 443a2367ba3c ("net: ti: icssg-prueth: am65x SR2.0 add 10M full duplex support")

Is there a reason you're not CCing authors of these changes?
Please make sure you run get_maintainer on the patch, and CC
folks appropriately.
-- 
pw-bot: cr
pv-bot: cc
Re: [PATCH net v3] net: ti: icssg-prueth: Add missing icss_iep_put to error path
Posted by Jan Kiszka 2 years, 1 month ago
On 08.11.23 03:32, Jakub Kicinski wrote:
> On Mon, 6 Nov 2023 12:47:42 +0100 Jan Kiszka wrote:
>> Analogously to prueth_remove, just also taking care for NULL'ing the
>> iep pointers.
>>
>> Fixes: 186734c15886 ("net: ti: icssg-prueth: add packet timestamping and ptp support")
>> Fixes: 443a2367ba3c ("net: ti: icssg-prueth: am65x SR2.0 add 10M full duplex support")
> 
> Is there a reason you're not CCing authors of these changes?
> Please make sure you run get_maintainer on the patch, and CC
> folks appropriately.

I was only interacting (directly) with Danish in the past years on this
driver, and he also upstreamed it. So I assumed "ownership" moved on.
Adding both, Roger with updated email (where get_maintainer does not help).

Jan

-- 
Siemens AG, Technology
Linux Expert Center
Re: [PATCH net v3] net: ti: icssg-prueth: Add missing icss_iep_put to error path
Posted by Jakub Kicinski 2 years, 1 month ago
On Thu, 9 Nov 2023 12:08:21 +0100 Jan Kiszka wrote:
> > Is there a reason you're not CCing authors of these changes?
> > Please make sure you run get_maintainer on the patch, and CC
> > folks appropriately.  
> 
> I was only interacting (directly) with Danish in the past years on this
> driver, and he also upstreamed it. So I assumed "ownership" moved on.
> Adding both, Roger with updated email (where get_maintainer does not help).

You'll need to repost the patch, it's been dropped from patchwork.

Roger, if your old address doesn't work any more please add an entry
to .mailmap.
Re: [PATCH net v3] net: ti: icssg-prueth: Add missing icss_iep_put to error path
Posted by Wojciech Drewek 2 years, 1 month ago

On 06.11.2023 12:47, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> Analogously to prueth_remove, just also taking care for NULL'ing the
> iep pointers.
> 
> Fixes: 186734c15886 ("net: ti: icssg-prueth: add packet timestamping and ptp support")
> Fixes: 443a2367ba3c ("net: ti: icssg-prueth: am65x SR2.0 add 10M full duplex support")
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---

Thanks!
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>

> 
> Changes in v3:
>  - consolidate cleanup logic further [Wojciech]
>  - make sure to NULL iep pointers
> 
> Changes in v2:
>  - add proper tags
> 
> This was lost from the TI SDK version while ripping out SR1.0 support - which we are currently restoring for upstream.
> 
>  drivers/net/ethernet/ti/icssg/icssg_prueth.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
> index 6c4b64227ac8..3abbeba26f1b 100644
> --- a/drivers/net/ethernet/ti/icssg/icssg_prueth.c
> +++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
> @@ -2105,10 +2105,7 @@ static int prueth_probe(struct platform_device *pdev)
>  	prueth->iep1 = icss_iep_get_idx(np, 1);
>  	if (IS_ERR(prueth->iep1)) {
>  		ret = dev_err_probe(dev, PTR_ERR(prueth->iep1), "iep1 get failed\n");
> -		icss_iep_put(prueth->iep0);
> -		prueth->iep0 = NULL;
> -		prueth->iep1 = NULL;
> -		goto free_pool;
> +		goto put_iep0;
>  	}
>  
>  	if (prueth->pdata.quirk_10m_link_issue) {
> @@ -2205,6 +2202,12 @@ static int prueth_probe(struct platform_device *pdev)
>  exit_iep:
>  	if (prueth->pdata.quirk_10m_link_issue)
>  		icss_iep_exit_fw(prueth->iep1);
> +	icss_iep_put(prueth->iep1);
> +
> +put_iep0:
> +	icss_iep_put(prueth->iep0);
> +	prueth->iep0 = NULL;
> +	prueth->iep1 = NULL;
>  
>  free_pool:
>  	gen_pool_free(prueth->sram_pool,