[PATCH] drm/mediatek: Initialize ret in mtk_drm_of_ddp_path_build()

Chun-Kuang Hu chunkuang.hu at kernel.org
Wed Dec 2 15:57:51 PST 2026


Ian Rogers <irogers at google.com> 於 2026年11月19日週四 下午5:10寫道:
>
> of_graph_is_present() returns true when a port or ports node exists in
> Device Tree even if it has zero enabled endpoint children. In that
> case, for_each_endpoint_of_node() in mtk_drm_of_ddp_path_build()
> executes zero iterations and 'if (ret)' evaluates an uninitialized
> stack variable, aborting probe with stack garbage.
>
> Initialize ret to 0.
>
> Found via Clang -Wconditional-uninitialized on an x86_64 allyesconfig
> build. Verified by building drivers/gpu/drm/mediatek/mtk_drm_drv.o
> with LLVM=1 W=1 (-Werror) and -Wconditional-uninitialized; not
> runtime-tested on MediaTek SoC hardware.

Applied to mediatek-drm-fixes [1], thanks.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-fixes

Regards,
Chun-Kuang.

>
> Fixes: 4c932840db1d ("drm/mediatek: Implement OF graphs support for display paths")
> Signed-off-by: Ian Rogers <irogers at google.com>
> ---



More information about the linux-arm-kernel mailing list