[PATCH] drm/imx/dcss: Fix clock leak on blkctl init failure

Laurentiu Palcu laurentiu.palcu at oss.nxp.com
Fri Oct 30 02:26:22 PDT 2026


Hi,

Thank you for the fix.

On Fri, Oct 30, 2026 at 04:33:42PM +0800, laixiangwu wrote:
> dcss_submodules_init() enables the DCSS clocks before initializing the
> submodules, but if the first submodule (blkctl) fails to initialize the
> function returns directly, without disabling the clocks again. All the
> later error paths already jump to ctxld_err, which calls
> dcss_clocks_disable().
> 
> Since the clocks are only devm-managed for their reference (devm_clk_get),
> a blkctl init failure leaves all five DCSS clocks prepared and enabled.
> 
> Jump to ctxld_err so the clocks are disabled like on the other error
> paths.
> 
> Fixes: 9021c317b770 ("drm/imx: Add initial support for DCSS on iMX8MQ")
> Signed-off-by: laixiangwu <laixiangwu at cmss.chinamobile.com>
> ---
>  drivers/gpu/drm/imx/dcss/dcss-dev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/imx/dcss/dcss-dev.c b/drivers/gpu/drm/imx/dcss/dcss-dev.c
> index 7fd0c4c14..551786060 100644
> --- a/drivers/gpu/drm/imx/dcss/dcss-dev.c
> +++ b/drivers/gpu/drm/imx/dcss/dcss-dev.c
> @@ -70,7 +70,7 @@ static int dcss_submodules_init(struct dcss_dev *dcss)
> 
>         ret = dcss_blkctl_init(dcss, base_addr + devtype->blkctl_ofs);
>         if (ret)
> -               return ret;
> +               goto ctxld_err;

With this change, now the label names I chose when I first developed this
driver don't feel right. Could you please send a v2 and rename those labels
below as well?

I'm thinking:
ctxld_err -> err_clocks
dtg_err -> err_ctxld
ss_err -> err_dtg
dpr_err -> err_ss
scaler_err -> err_dpr

Update those 'goto' lines accordingly.

-- 
Thanks,
Laurentiu



More information about the linux-arm-kernel mailing list