clk: imx: imx8: Fix an error handling path if devm_clk_hw_register_mux_parent_data_ta...
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Thu, 14 Sep 2023 20:31:03 +0000 (22:31 +0200)
committerAbel Vesa <abel.vesa@linaro.org>
Wed, 4 Oct 2023 08:13:58 +0000 (11:13 +0300)
If a devm_clk_hw_register_mux_parent_data_table() call fails, it is likely
that the probe should fail with an error code.

Set 'ret' before leaving the function.

Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver")
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
drivers/clk/imx/clk-imx8-acm.c

index 87025a6772d0ecc83a9dfee5a3bc826dfecdcbe0..73b3b535495177e470743dc89b75c6e1a2adedd6 100644 (file)
@@ -373,6 +373,7 @@ static int imx8_acm_clk_probe(struct platform_device *pdev)
                                                                                sels[i].shift, sels[i].width,
                                                                                0, NULL, NULL);
                if (IS_ERR(hws[sels[i].clkid])) {
+                       ret = PTR_ERR(hws[sels[i].clkid]);
                        pm_runtime_disable(&pdev->dev);
                        goto err_clk_register;
                }