]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
net: fec_mxc: Set error code on error exit
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Tue, 5 Aug 2025 11:23:06 +0000 (12:23 +0100)
committerFabio Estevam <festevam@gmail.com>
Thu, 7 Aug 2025 11:16:18 +0000 (08:16 -0300)
In fecmxc_probe if a timeout is detected when resetting the chip no
error code is set before taking the error exit. This could lead to a
silent failure. Instead set an error code.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
drivers/net/fec_mxc.c

index 54b08482b9143d2f715c51fe5c8ee53c0d0d1e0f..9ac72d25ef6d5539a47931ff6c071685fcd85057 100644 (file)
@@ -1344,6 +1344,7 @@ static int fecmxc_probe(struct udevice *dev)
        while (readl(&priv->eth->ecntrl) & FEC_ECNTRL_RESET) {
                if (get_timer(start) > (CONFIG_SYS_HZ * 5)) {
                        printf("FEC MXC: Timeout resetting chip\n");
+                       ret = -ETIMEDOUT;
                        goto err_timeout;
                }
                udelay(10);