[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220617112636.4041671-1-windhl@126.com>
Date: Fri, 17 Jun 2022 19:26:36 +0800
From: Liang He <windhl@....com>
To: mpe@...erman.id.au, benh@...nel.crashing.org, paulus@...ba.org,
akpm@...ux-foundation.org, rppt@...nel.org,
christophe.leroy@...roup.eu, wangkefeng.wang@...wei.com,
gpiccoli@...lia.com, aneesh.kumar@...ux.ibm.com,
dmitry.osipenko@...labora.com
Cc: windhl@....com, linuxppc-dev@...ts.ozlabs.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] powerpc: kernel: Change the order of of_node_put()
In add_pcspkr(), it is better to call of_node_put() after the
'if(!np)' check.
Signed-off-by: Liang He <windhl@....com>
---
arch/powerpc/kernel/setup-common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index eb0077b302e2..761817d1f4db 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -563,9 +563,9 @@ static __init int add_pcspkr(void)
int ret;
np = of_find_compatible_node(NULL, NULL, "pnpPNP,100");
- of_node_put(np);
if (!np)
return -ENODEV;
+ of_node_put(np);
pd = platform_device_alloc("pcspkr", -1);
if (!pd)
--
2.25.1
Powered by blists - more mailing lists