[PATCH 1/5] net: fsl_enetc: Fix copy/paste error

Andrew Goodbody andrew.goodbody at linaro.org
Mon Aug 4 18:56:55 CEST 2025


In netc_blk_ctrl_probe the test for failure of the function
clk_prepare_enable should not return PTR_ERR(ipg_clk) as it does not
check IS_ERR(ipg_clk) instead it should return err as that is what is
holding the error code in this case.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody at linaro.org>
---
 drivers/net/fsl_enetc_netc_blk_ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/fsl_enetc_netc_blk_ctrl.c b/drivers/net/fsl_enetc_netc_blk_ctrl.c
index 46b68d3d8a4..fecd66eb15a 100644
--- a/drivers/net/fsl_enetc_netc_blk_ctrl.c
+++ b/drivers/net/fsl_enetc_netc_blk_ctrl.c
@@ -293,7 +293,7 @@ static int netc_blk_ctrl_probe(struct udevice *dev)
 	err = clk_prepare_enable(ipg_clk);
 	if (err) {
 		dev_err(dev, "Enable ipg clock failed\n");
-		return PTR_ERR(ipg_clk);
+		return err;
 	}
 
 	regs = dev_read_addr_name(dev, "ierb");

-- 
2.39.5



More information about the U-Boot mailing list