]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
clk: Return value calculated by ERR_PTR
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Thu, 3 Jul 2025 14:40:46 +0000 (15:40 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 28 Oct 2025 16:32:59 +0000 (10:32 -0600)
In clk_set_default_get_by_id ret is passed to ERR_PTR but nothing is
done with the value that this calculates which is obviously not the
intention of the code. This is confirmed by the code around where this
function is called.
Instead return the value from ERR_PTR.

This issue found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Acked-by: Quentin Schulz <quentin.schulz@cherry.de>
drivers/clk/clk-uclass.c

index 3dbe1ce9441ca513d41be90520ff175c96b4253a..dc01f612ba62be9b80570034b29c5e2bfe3bfa1c 100644 (file)
@@ -199,7 +199,7 @@ static struct clk *clk_set_default_get_by_id(struct clk *clk)
                if (ret) {
                        debug("%s(): could not get parent clock pointer, id %lu\n",
                              __func__, clk->id);
-                       ERR_PTR(ret);
+                       return ERR_PTR(ret);
                }
        }