]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/mediatek: Fix device node reference leak in mtk_dp_dt_parse()
authorMiaoqian Lin <linmq006@gmail.com>
Wed, 29 Oct 2025 07:23:06 +0000 (15:23 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:14:53 +0000 (10:14 +0100)
commit27e44ca6465e30aaee25065d5d354343ce1046a9
tree068867267e6328e0be7945b904bbe5475bdf5d1d
parentc6d30b65b7a44dac52ad49513268adbf19eab4a2
drm/mediatek: Fix device node reference leak in mtk_dp_dt_parse()

commit a846505a193d7492ad3531e33cacfca31e4bcdd1 upstream.

The function mtk_dp_dt_parse() calls of_graph_get_endpoint_by_regs()
to get the endpoint device node, but fails to call of_node_put() to release
the reference when the function returns. This results in a device node
reference leak.

Fix this by adding the missing of_node_put() call before returning from
the function.

Found via static analysis and code review.

Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver")
Cc: stable@vger.kernel.org
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Markus Schneider-Pargmann <msp@baylibre.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20251029072307.10955-1-linmq006@gmail.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/mediatek/mtk_dp.c