]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/mediatek: Fix probe memory leak
authorJohan Hovold <johan@kernel.org>
Tue, 23 Sep 2025 15:23:37 +0000 (17:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:17:17 +0000 (10:17 +0100)
commite048e15c97e827ef7f6500292dc3d528f556742f
treec396cb7ff29b599f02d053bd67d5aeef692e3bef
parent54291161eeaaea7b3e1d059a9ec9295337af636c
drm/mediatek: Fix probe memory leak

commit 5e49200593f331cd0629b5376fab9192f698e8ef upstream.

The Mediatek DRM driver allocates private data for components without a
platform driver but as the lifetime is tied to each component device,
the memory is never freed.

Tie the allocation lifetime to the DRM platform device so that the
memory is released on probe failure (e.g. probe deferral) and when the
driver is unbound.

Fixes: c0d36de868a6 ("drm/mediatek: Move clk info from struct mtk_ddp_comp to sub driver private data")
Cc: stable@vger.kernel.org # 5.12
Cc: CK Hu <ck.hu@mediatek.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20250923152340.18234-3-johan@kernel.org/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/mediatek/mtk_ddp_comp.c