Skip to content

Commit 1401cf6

Browse files
Wei Yongjundavem330
authored andcommitted
net: ethernet: ti: am65-cpsw-nuss: fix error handling of am65_cpsw_nuss_probe
Convert to using IS_ERR() instead of NULL test for cpsw_ale_create() error handling. Also fix to return negative error code from this error handling case instead of 0 in. Fixes: 93a7653 ("net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3469660 commit 1401cf6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/ti/am65-cpsw-nuss.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1895,8 +1895,9 @@ static int am65_cpsw_nuss_probe(struct platform_device *pdev)
18951895
ale_params.nu_switch_ale = true;
18961896

18971897
common->ale = cpsw_ale_create(&ale_params);
1898-
if (!common->ale) {
1898+
if (IS_ERR(common->ale)) {
18991899
dev_err(dev, "error initializing ale engine\n");
1900+
ret = PTR_ERR(common->ale);
19001901
goto err_of_clear;
19011902
}
19021903

0 commit comments

Comments
 (0)