Skip to content

Commit b9cc459

Browse files
Yuuoniyrobclark
authored andcommitted
drm/msm/mdp4: Fix refcount leak in mdp4_modeset_init_intf
of_graph_get_remote_node() returns remote device node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: 86418f9 ("drm: convert drivers to use of_graph_get_remote_node") Signed-off-by: Miaoqian Lin <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Reviewed-by: Abhinav Kumar <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/488473/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Clark <[email protected]>
1 parent c8af219 commit b9cc459

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4_kms,
216216
encoder = mdp4_lcdc_encoder_init(dev, panel_node);
217217
if (IS_ERR(encoder)) {
218218
DRM_DEV_ERROR(dev->dev, "failed to construct LCDC encoder\n");
219+
of_node_put(panel_node);
219220
return PTR_ERR(encoder);
220221
}
221222

@@ -225,6 +226,7 @@ static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4_kms,
225226
connector = mdp4_lvds_connector_init(dev, panel_node, encoder);
226227
if (IS_ERR(connector)) {
227228
DRM_DEV_ERROR(dev->dev, "failed to initialize LVDS connector\n");
229+
of_node_put(panel_node);
228230
return PTR_ERR(connector);
229231
}
230232

0 commit comments

Comments
 (0)