Skip to contentSkip to conversation

net: ti: icssg-prueth: Add missing icss_iep_put to error path

PATCH Applied Jan Kiszka 4 participants 4 messages Nov 10, 2023 – Nov 11, 2023

Subsystems (3)
lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH v4 1/1 net: ti: icssg-prueth: Add missing icss_iep_put to error path

From: Jan Kiszka <[email protected]>

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

---

Changes in v4:
- no functional ones
- added one original author in CC with new address (no address of Grygorii available)

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(-)
drivers/net/ethernet/ti/icssg/icssg_prueth.c +7 -4
index 6c4b64227ac8..3abbeba26f1b 100644
@@ -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,
Signature · 1 line
2.35.3
Reviewed-by MD Danish Anwar on v4 1/1
#1 lore raw
Quoted 9 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

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")
Quoted 49 lines

---

Changes in v4:
- no functional ones
- added one original author in CC with new address (no address of Grygorii available)

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(-)
drivers/net/ethernet/ti/icssg/icssg_prueth.c +7 -4
index 6c4b64227ac8..3abbeba26f1b 100644
@@ -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,
Signature · 2 lines
Thanks and Regards,
Md Danish Anwar
reviewer Reviewed-by on v4 1/1
#2 lore raw
In reply to Jan Kiszka
Quoted 9 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

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")
#3 lore raw
In reply to Jan Kiszka
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:

Quoted 11 lines · On Fri, 10 Nov 2023 17:13:02 +0100 you wrote:

From: Jan Kiszka <[email protected]>

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

[...]

Here is the summary with links:
- [net,v4] net: ti: icssg-prueth: Add missing icss_iep_put to error path

    https://git.kernel.org/netdev/net/c/e409d7346648

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html