Skip to contentSkip to conversation

net: bcmasp: Fix error code in probe()

PATCH Applied Dan Carpenter 5 participants 5 messages Jul 4, 2024 – Jul 6, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: bcmasp: Fix error code in probe()

Return an error code if bcmasp_interface_create() fails. Don't return success.

Fixes 490cb412007d ("net: bcmasp: Add support for ASP2.0 Ethernet controller")
---
 drivers/net/ethernet/broadcom/asp2/bcmasp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/asp2/bcmasp.c +1 -0
index a806dadc4196..20c6529ec135 100644
@@ -1380,6 +1380,7 @@ static int bcmasp_probe(struct platform_device *pdev)
 			dev_err(dev, "Cannot create eth interface %d\n", i);
 			bcmasp_remove_intfs(priv);
 			of_node_put(intf_node);
+			ret = -ENOMEM;
 			goto of_put_exit;
 		}
 		list_add_tail(&intf->list, &priv->intfs);
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 1 line · Dan Carpenter

Return an error code if bcmasp_interface_create() fails. Don't return

nitpick: redundant space after "fails."

Quoted 24 lines

success.

Fixes 490cb412007d ("net: bcmasp: Add support for ASP2.0 Ethernet controller")
---
 drivers/net/ethernet/broadcom/asp2/bcmasp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/asp2/bcmasp.c +1 -0
index a806dadc4196..20c6529ec135 100644
@@ -1380,6 +1380,7 @@ static int bcmasp_probe(struct platform_device *pdev)
 			dev_err(dev, "Cannot create eth interface %d\n", i);
 			bcmasp_remove_intfs(priv);
 			of_node_put(intf_node);
+			ret = -ENOMEM;
 			goto of_put_exit;
 		}
 		list_add_tail(&intf->list, &priv->intfs);
Signature · 1 line
2.43.0

The patch actually fixes an obvious bug.

Thanks,

#2 lore raw
In reply to Dan Carpenter
Quoted 2 lines

Return an error code if bcmasp_interface_create() fails. Don't return success.

Would you like to refer to the function name “bcmasp_probe” in the summary phrase?

Regards,
Markus

maintainer Reviewed-by on v1 1/1
#3 lore raw
In reply to Dan Carpenter
Quoted 5 lines · Dan Carpenter

Return an error code if bcmasp_interface_create() fails. Don't return success.

Fixes 490cb412007d ("net: bcmasp: Add support for ASP2.0 Ethernet controller")
Quoted 16 lines
---
  drivers/net/ethernet/broadcom/asp2/bcmasp.c | 1 +
  1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/asp2/bcmasp.c +1 -0
index a806dadc4196..20c6529ec135 100644
@@ -1380,6 +1380,7 @@ static int bcmasp_probe(struct platform_device *pdev)
  			dev_err(dev, "Cannot create eth interface %d\n", i);
  			bcmasp_remove_intfs(priv);
  			of_node_put(intf_node);
+			ret = -ENOMEM;
  			goto of_put_exit;
  		}
  		list_add_tail(&intf->list, &priv->intfs);
#4 lore raw
In reply to Dan Carpenter
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

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

Quoted 8 lines · On Thu, 4 Jul 2024 10:19:44 -0500 you wrote:

Return an error code if bcmasp_interface_create() fails. Don't return success.

Fixes 490cb412007d ("net: bcmasp: Add support for ASP2.0 Ethernet controller")
---
 drivers/net/ethernet/broadcom/asp2/bcmasp.c | 1 +
 1 file changed, 1 insertion(+)

Here is the summary with links:
- [net] net: bcmasp: Fix error code in probe()

    https://git.kernel.org/netdev/net/c/0c754d9d86ff

You are awesome, thank you!

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