Skip to content

Commit

Permalink
drm/mcde: Fix refcount leak in mcde_dsi_bind
Browse files Browse the repository at this point in the history
Every iteration of for_each_available_child_of_node() decrements
the reference counter of the previous node. There is no decrement
when break out from the loop and results in refcount leak.
Add missing of_node_put() to fix this.

Fixes: 5fc537b ("drm/mcde: Add new driver for ST-Ericsson MCDE")
Signed-off-by: Miaoqian Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
Yuuoniy authored and linusw committed Jun 27, 2022
1 parent e5d6eee commit 3a14916
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/mcde/mcde_dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1111,6 +1111,7 @@ static int mcde_dsi_bind(struct device *dev, struct device *master,
bridge = of_drm_find_bridge(child);
if (!bridge) {
dev_err(dev, "failed to find bridge\n");
of_node_put(child);
return -EINVAL;
}
}
Expand Down

0 comments on commit 3a14916

Please sign in to comment.