Fix to return negative error code -ENOMEM from the cpsw_ale_create()
error handling case instead of 0, as done elsewhere in this function.

Fixes: 93a76530316a ("net: ethernet: ti: introduce am65x/j721e gigabit eth 
subsystem driver")
Reported-by: Hulk Robot <hul...@huawei.com>
Signed-off-by: Wei Yongjun <weiyongj...@huawei.com>
---
 drivers/net/ethernet/ti/am65-cpsw-nuss.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c 
b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
index f8c589929308..066ba52f57cb 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
@@ -2065,6 +2065,7 @@ static int am65_cpsw_nuss_probe(struct platform_device 
*pdev)
        common->ale = cpsw_ale_create(&ale_params);
        if (!common->ale) {
                dev_err(dev, "error initializing ale engine\n");
+               ret = -ENOMEM;
                goto err_of_clear;
        }



Reply via email to