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 |
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>
> 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
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);
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 --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);
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(+)