From 644b4650ee57c429bede77f44752cc867dac0e00 Mon Sep 17 00:00:00 2001 From: Andrew Goodbody Date: Thu, 3 Jul 2025 15:40:46 +0100 Subject: [PATCH] clk: Return value calculated by ERR_PTR 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 Acked-by: Quentin Schulz --- drivers/clk/clk-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index 3dbe1ce9441..dc01f612ba6 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -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); } } -- 2.47.3