devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] of/irq: Make sure to update out_irq->np to the new parent in of_irq_parse_raw
@ 2024-07-30  5:52 WHR
  2024-07-31 21:58 ` Rob Herring
  0 siblings, 1 reply; 7+ messages in thread
From: WHR @ 2024-07-30  5:52 UTC (permalink / raw)
  To: Rob Herring, Saravana Kannan; +Cc: devicetree, linux-kernel

Commit 935df1bd40d43c4ee91838c42a20e9af751885cc has removed an
assignment statement for 'out_irq->np' right after label 'skiplevel',
causing the new parent acquired from function of_irq_find_parent didn't
being stored to 'out_irq->np' as it supposed to. Under some conditions
this can resuit in multiple corruptions and leakages to device nodes.

Update 'out_irq->np' before jumping to label 'skiplevel'.

Fixes: 935df1bd40d4 ("of/irq: Factor out parsing of interrupt-map parent
phandle+args from of_irq_parse_raw()")
Signed-off-by: WHR <whr@rivoreo.one>
---
v2:
Add 'Fixes:' line, and update subject.

 drivers/of/irq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index c94203ce65bb..580b33ce60d2 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -263,6 +263,7 @@ int of_irq_parse_raw(const __be32 *addr, struct
of_phandle_args *out_irq)
 		if (imap == NULL) {
 			pr_debug(" -> no map, getting parent\n");
 			newpar = of_irq_find_parent(ipar);
+			out_irq->np = newpar;
 			goto skiplevel;
 		}
 		imaplen /= sizeof(u32);
-- 
2.30.2





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

end of thread, other threads:[~2024-08-02 11:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-30  5:52 [PATCH v2] of/irq: Make sure to update out_irq->np to the new parent in of_irq_parse_raw WHR
2024-07-31 21:58 ` Rob Herring
2024-08-01  4:14   ` WHR
2024-08-01  4:20   ` WHR
2024-08-01 14:49     ` Rob Herring
2024-08-02 11:32       ` WHR
2024-08-02 11:45       ` WHR

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).