From: Liang He Date: Mon, 11 Jul 2022 13:15:50 +0000 (+0800) Subject: drm:pl111: Add of_node_put() when breaking out of for_each_available_child_of_node() X-Git-Tag: v6.1-rc1~159^2~18^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e0686dc6f2252e009c455fe99e2ce9d62a60eb47;p=thirdparty%2Fkernel%2Flinux.git drm:pl111: Add of_node_put() when breaking out of for_each_available_child_of_node() 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: ca454bd42dc2 ("drm/pl111: Support the Versatile Express") Signed-off-by: Liang He Reviewed-by: Rob Herring Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220711131550.361350-1-windhl@126.com --- diff --git a/drivers/gpu/drm/pl111/pl111_versatile.c b/drivers/gpu/drm/pl111/pl111_versatile.c index efb01a5545740..1b436b75fd396 100644 --- a/drivers/gpu/drm/pl111/pl111_versatile.c +++ b/drivers/gpu/drm/pl111/pl111_versatile.c @@ -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")) {