On 08/05/2020 05:10, Wei Yongjun wrote:
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 <[email protected]>
Signed-off-by: Wei Yongjun <[email protected]>
---
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;
}
It seems not enough.
For consistency, Could you update it as below?
- cpsw_ale_create() to return PTR_ERR() in all places
- users to use IS_ERR() and ret = PTR_ERR()
--
Best regards,
grygorii