]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
net: fsl_enetc: Fix copy/paste error
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Mon, 4 Aug 2025 16:56:55 +0000 (17:56 +0100)
committerPeng Fan <peng.fan@nxp.com>
Wed, 27 Aug 2025 07:42:07 +0000 (15:42 +0800)
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@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/net/fsl_enetc_netc_blk_ctrl.c

index 46b68d3d8a4fc3df42e69561b6a2902981666ecf..fecd66eb15a8c1cf315fe866cf7821f14d3b7cf2 100644 (file)
@@ -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");