Message ID | 20241009063229.121258-2-zhangzekun11@huawei.com (mailing list archive) |
---|---|
State | Awaiting Upstream, archived |
Headers | show |
Series | clk: Fix the use of uninitialized variable | expand |
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);
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(-)