Skip to content

Commit 5e49200

Browse files
jhovoldChun-Kuang Hu
authored andcommitted
drm/mediatek: Fix probe memory leak
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: c0d36de ("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>
1 parent 07c7c64 commit 5e49200

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/mediatek/mtk_ddp_comp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ int mtk_ddp_comp_init(struct device *dev, struct device_node *node, struct mtk_d
671671
type == MTK_DSI)
672672
return 0;
673673

674-
priv = devm_kzalloc(comp->dev, sizeof(*priv), GFP_KERNEL);
674+
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
675675
if (!priv)
676676
return -ENOMEM;
677677

0 commit comments

Comments
 (0)