Skip to content

Commit

Permalink
drm:pl111: Add of_node_put() when breaking out of for_each_available_…
Browse files Browse the repository at this point in the history
…child_of_node()

[ Upstream commit e0686dc ]

The reference 'child' in the iteration of for_each_available_child_of_node()
is only escaped out into a local variable which is only used to check
its value. So we still need to the of_node_put() when breaking of the
for_each_available_child_of_node() which will automatically increase
and decrease the refcount.

Fixes: ca454bd ("drm/pl111: Support the Versatile Express")
Signed-off-by: Liang He <windhl@126.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20220711131550.361350-1-windhl@126.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
windhl authored and gregkh committed Oct 21, 2022
1 parent fcc7364 commit d012fc4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/pl111/pl111_versatile.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ static int pl111_vexpress_clcd_init(struct device *dev, struct device_node *np,
if (of_device_is_compatible(child, "arm,pl111")) {
has_coretile_clcd = true;
ct_clcd = child;
of_node_put(child);
break;
}
if (of_device_is_compatible(child, "arm,hdlcd")) {
Expand Down

0 comments on commit d012fc4

Please sign in to comment.