summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/mediatek
diff options
context:
space:
mode:
authorJavier Carrasco <javier.carrasco.cruz@gmail.com>2024-06-24 18:43:47 +0200
committerChun-Kuang Hu <chunkuang.hu@kernel.org>2024-08-15 13:52:46 +0000
commit5beb6fba25db235b52eab34bde8112f07bb31d75 (patch)
tree789eea4fc7dcf06b1bc257694cb993690bc6d5a0 /drivers/gpu/drm/mediatek
parentd88464a80a286bfafe5c9d08747be3a69e6104cc (diff)
downloadlwn-5beb6fba25db235b52eab34bde8112f07bb31d75.tar.gz
lwn-5beb6fba25db235b52eab34bde8112f07bb31d75.zip
drm/mediatek: ovl_adaptor: Add missing of_node_put()
Error paths that exit for_each_child_of_node() need to call of_node_put() to decerement the child refcount and avoid memory leaks. Add the missing of_node_put(). Cc: stable@vger.kernel.org Fixes: 453c3364632a ("drm/mediatek: Add ovl_adaptor support for MT8195") Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com> Reviewed-by: CK Hu <ck.hu@mediatek.com> Link: https://patchwork.kernel.org/project/dri-devel/patch/20240624-mtk_disp_ovl_adaptor_scoped-v1-2-9fa1e074d881@gmail.com/ Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/mediatek')
-rw-r--r--drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
index ca20cad800db..436c1af4c992 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
@@ -522,8 +522,10 @@ static int ovl_adaptor_comp_init(struct device *dev, struct component_match **ma
}
comp_pdev = of_find_device_by_node(node);
- if (!comp_pdev)
+ if (!comp_pdev) {
+ of_node_put(node);
return -EPROBE_DEFER;
+ }
priv->ovl_adaptor_comp[id] = &comp_pdev->dev;