Skip to content

Commit 5beb6fb

Browse files
javiercarrascocruzChun-Kuang Hu
authored andcommitted
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: [email protected] Fixes: 453c336 ("drm/mediatek: Add ovl_adaptor support for MT8195") Signed-off-by: Javier Carrasco <[email protected]> Reviewed-by: CK Hu <[email protected]> Link: https://patchwork.kernel.org/project/dri-devel/patch/[email protected]/ Signed-off-by: Chun-Kuang Hu <[email protected]>
1 parent d88464a commit 5beb6fb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,10 @@ static int ovl_adaptor_comp_init(struct device *dev, struct component_match **ma
522522
}
523523

524524
comp_pdev = of_find_device_by_node(node);
525-
if (!comp_pdev)
525+
if (!comp_pdev) {
526+
of_node_put(node);
526527
return -EPROBE_DEFER;
528+
}
527529

528530
priv->ovl_adaptor_comp[id] = &comp_pdev->dev;
529531

0 commit comments

Comments
 (0)