linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] powerpc/44x/fsp2: add missing of_node_put
@ 2021-10-28  7:28 Bixuan Cui
  2021-11-02 10:12 ` Michael Ellerman
  0 siblings, 1 reply; 3+ messages in thread
From: Bixuan Cui @ 2021-10-28  7:28 UTC (permalink / raw)
  To: linuxppc-dev, linux-kernel; +Cc: cuibixuan, ivan, paulus

Early exits from for_each_compatible_node() should decrement the
node reference counter.  Reported by Coccinelle:

./arch/powerpc/platforms/44x/fsp2.c:206:1-25: WARNING: Function
"for_each_compatible_node" should have of_node_put() before return
around line 218.

Fixes: 7813043e1bbc ("powerpc/44x/fsp2: Add irq error handlers")
Signed-off-by: Bixuan Cui <cuibixuan@linux.alibaba.com>
---
 arch/powerpc/platforms/44x/fsp2.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/platforms/44x/fsp2.c b/arch/powerpc/platforms/44x/fsp2.c
index b299e43..823397c 100644
--- a/arch/powerpc/platforms/44x/fsp2.c
+++ b/arch/powerpc/platforms/44x/fsp2.c
@@ -208,6 +208,7 @@ static void node_irq_request(const char *compat, irq_handler_t errirq_handler)
 		if (irq == NO_IRQ) {
 			pr_err("device tree node %pOFn is missing a interrupt",
 			      np);
+			of_node_put(np);
 			return;
 		}
 
@@ -215,6 +216,7 @@ static void node_irq_request(const char *compat, irq_handler_t errirq_handler)
 		if (rc) {
 			pr_err("fsp_of_probe: request_irq failed: np=%pOF rc=%d",
 			      np, rc);
+			of_node_put(np);
 			return;
 		}
 	}
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] powerpc/44x/fsp2: add missing of_node_put
  2021-10-28  7:28 [PATCH -next] powerpc/44x/fsp2: add missing of_node_put Bixuan Cui
@ 2021-11-02 10:12 ` Michael Ellerman
  2021-11-03  7:30   ` Bixuan Cui
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Ellerman @ 2021-11-02 10:12 UTC (permalink / raw)
  To: Bixuan Cui, linux-kernel, linuxppc-dev; +Cc: ivan, paulus

On Thu, 28 Oct 2021 15:28:22 +0800, Bixuan Cui wrote:
> Early exits from for_each_compatible_node() should decrement the
> node reference counter.  Reported by Coccinelle:
> 
> ./arch/powerpc/platforms/44x/fsp2.c:206:1-25: WARNING: Function
> "for_each_compatible_node" should have of_node_put() before return
> around line 218.
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/44x/fsp2: add missing of_node_put
      https://git.kernel.org/powerpc/c/290fe8aa69ef5c51c778c0bb33f8ef0181c769f5

cheers

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] powerpc/44x/fsp2: add missing of_node_put
  2021-11-02 10:12 ` Michael Ellerman
@ 2021-11-03  7:30   ` Bixuan Cui
  0 siblings, 0 replies; 3+ messages in thread
From: Bixuan Cui @ 2021-11-03  7:30 UTC (permalink / raw)
  To: Michael Ellerman, linux-kernel, linuxppc-dev; +Cc: ivan, paulus

[-- Attachment #1: Type: text/plain, Size: 532 bytes --]


在 2021/11/2 下午6:12, Michael Ellerman 写道:
>> Early exits from for_each_compatible_node() should decrement the
>> node reference counter.  Reported by Coccinelle:
>>
>> ./arch/powerpc/platforms/44x/fsp2.c:206:1-25: WARNING: Function
>> "for_each_compatible_node" should have of_node_put() before return
>> around line 218.
>>
>> [...]
> Applied to powerpc/next.
>
> [1/1] powerpc/44x/fsp2: add missing of_node_put
>        https://git.kernel.org/powerpc/c/290fe8aa69ef5c51c778c0bb33f8ef0181c769f5

Thanks. :-)


Bixuan Cui

[-- Attachment #2: Type: text/html, Size: 1192 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-03 21:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-28  7:28 [PATCH -next] powerpc/44x/fsp2: add missing of_node_put Bixuan Cui
2021-11-02 10:12 ` Michael Ellerman
2021-11-03  7:30   ` Bixuan Cui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).