Re: [PATCH v2] of: Fix unbalanced of node refcount and memory leaks

From: Stephen Boyd
Date: Wed Oct 09 2024 - 18:12:14 EST


Quoting Jinjie Ruan (2024-10-08 18:49:50)
> diff --git a/drivers/of/overlay_test.c b/drivers/of/overlay_test.c
> index 19a292cdeee3..e95b1152612c 100644
> --- a/drivers/of/overlay_test.c
> +++ b/drivers/of/overlay_test.c
> @@ -73,12 +73,12 @@ static void of_overlay_apply_kunit_cleanup(struct kunit *test)
>
> np = of_find_node_by_name(NULL, kunit_node_name);
> KUNIT_ASSERT_NOT_ERR_OR_NULL(test, np);
> - of_node_put_kunit(test, np);

Thanks for the patch. This should be

of_node_put_kunit(&fake, np);

so that the node is put before the overlay is removed.

With that done you can add my

Reviewed-by: Stephen Boyd <sboyd@xxxxxxxxxx>