diff mbox series

[RESEND,1/4] clk: imx: scu: Fix the return of uninitialized variable

Message ID 20241024033424.115417-2-zhangzekun11@huawei.com (mailing list archive)
State Awaiting Upstream, archived
Headers show
Series clk: Fix the use of uninitialized variable | expand

Commit Message

zhangzekun (A) Oct. 24, 2024, 3:34 a.m. UTC
The of_property_read_u32() can fail and leave the variable uninitialized,
which will then be used. Return error if reading the property failed.

Fixes: 77d8f3068c63 ("clk: imx: scu: add two cells binding support")
Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com>
---
 drivers/clk/imx/clk-scu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c
index b1dd0c08e091..95798c6fea1c 100644
--- a/drivers/clk/imx/clk-scu.c
+++ b/drivers/clk/imx/clk-scu.c
@@ -194,7 +194,7 @@  static bool imx_scu_clk_is_valid(u32 rsrc_id)
 int imx_clk_scu_init(struct device_node *np,
 		     const struct imx_clk_scu_rsrc_table *data)
 {
-	u32 clk_cells;
+	u32 clk_cells = 0;
 	int ret, i;
 
 	ret = imx_scu_get_handle(&ccm_ipc_handle);