diff mbox series

[net] net: bcmasp: Fix error code in probe()

Message ID ZoWKBkHH9D1fqV4r@stanley.mountain (mailing list archive)
State Accepted
Commit 0c754d9d86ffdf2f86b4272b25d759843fb62fd8
Delegated to: Netdev Maintainers
Headers show
Series [net] net: bcmasp: Fix error code in probe() | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 856 this patch: 856
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 860 this patch: 860
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 860 this patch: 860
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-07-05--06-00 (tests: 695)

Commit Message

Dan Carpenter July 4, 2024, 3:19 p.m. UTC
Return an error code if bcmasp_interface_create() fails.  Don't return
success.

Fixes: 490cb412007d ("net: bcmasp: Add support for ASP2.0 Ethernet controller")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/net/ethernet/broadcom/asp2/bcmasp.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Michal Kubiak July 4, 2024, 3:49 p.m. UTC | #1
On Thu, Jul 04, 2024 at 10:19:44AM -0500, Dan Carpenter wrote:
> Return an error code if bcmasp_interface_create() fails.  Don't return

nitpick: redundant space after "fails."

> success.
> 
> Fixes: 490cb412007d ("net: bcmasp: Add support for ASP2.0 Ethernet controller")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>  drivers/net/ethernet/broadcom/asp2/bcmasp.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp.c b/drivers/net/ethernet/broadcom/asp2/bcmasp.c
> index a806dadc4196..20c6529ec135 100644
> --- a/drivers/net/ethernet/broadcom/asp2/bcmasp.c
> +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp.c
> @@ -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);
> -- 
> 2.43.0
> 
> 

The patch actually fixes an obvious bug.

Thanks,
Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>
Markus Elfring July 4, 2024, 4:02 p.m. UTC | #2
> 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
Justin Chen July 5, 2024, 10:49 p.m. UTC | #3
On 7/4/24 8:19 AM, Dan Carpenter 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")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Reviewed-by: Justin Chen <justin.chen@broadcom.com>

> ---
>   drivers/net/ethernet/broadcom/asp2/bcmasp.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp.c b/drivers/net/ethernet/broadcom/asp2/bcmasp.c
> index a806dadc4196..20c6529ec135 100644
> --- a/drivers/net/ethernet/broadcom/asp2/bcmasp.c
> +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp.c
> @@ -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);
patchwork-bot+netdevbpf@kernel.org July 6, 2024, 12:20 a.m. UTC | #4
Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

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")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>  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!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp.c b/drivers/net/ethernet/broadcom/asp2/bcmasp.c
index a806dadc4196..20c6529ec135 100644
--- a/drivers/net/ethernet/broadcom/asp2/bcmasp.c
+++ b/drivers/net/ethernet/broadcom/asp2/bcmasp.c
@@ -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);