]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
staging: most: dim2: check return value of clk_prepare_enable for PLL
authorArtem Lytkin <iprintercanon@gmail.com>
Mon, 16 Feb 2026 20:19:20 +0000 (20:19 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Feb 2026 14:01:51 +0000 (15:01 +0100)
The return value of clk_prepare_enable() for the PLL clock is not
checked, while the same call for the MLB clock is properly checked
earlier in the function. If clk_prepare_enable() fails, the driver
continues without the PLL clock enabled, leading to undefined
hardware behavior.

Add the missing error check and disable the MLB clock on failure to
keep the cleanup consistent with the rest of the function.

Signed-off-by: Artem Lytkin <iprintercanon@gmail.com>
Link: https://patch.msgid.link/20260216201921.1788-2-iprintercanon@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/dim2/dim2.c

index 6507b51937cc7e52e5ccd2abddc071fcd9dbf209..92c7a7d8fe7e84569f835e9e9a740317ee638727 100644 (file)
@@ -942,7 +942,12 @@ static int fsl_mx6_enable(struct platform_device *pdev)
                }
 
                writel(0x888, dev->io_base + 0x38);
-               clk_prepare_enable(dev->clk_pll);
+               ret = clk_prepare_enable(dev->clk_pll);
+               if (ret) {
+                       dev_err(&pdev->dev, "failed to enable pll clock\n");
+                       clk_disable_unprepare(dev->clk);
+                       return ret;
+               }
        }
 
        return 0;