[PATCH v2] arm/mach-omap2: Fix refcount leak bugs

Tony Lindgren tony at atomide.com
Mon Jun 27 21:05:17 PDT 2022


* Liang He <windhl at 126.com> [220620 15:49]:
> --- a/arch/arm/mach-omap2/omap4-common.c
> +++ b/arch/arm/mach-omap2/omap4-common.c
> @@ -135,6 +135,7 @@ static int __init omap4_sram_init(void)
>  		pr_warn("%s:Unable to allocate sram needed to handle errata I688\n",
>  			__func__);
>  	sram_pool = of_gen_pool_get(np, "sram", 0);
> +	of_node_put(np);
>  	if (!sram_pool)
>  		pr_warn("%s:Unable to get sram pool needed to handle errata I688\n",
>  			__func__);

Here sram_pool is used after of_node_put() on it. Don't we want to do the
put only after no users?

Regards,

Tony



More information about the linux-arm-kernel mailing list