public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: "WHR" <whr@rivoreo.one>
To: "Rob Herring" <robh@kernel.org>,
	"Saravana Kannan" <saravanak@google.com>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] of/irq: Make sure to update out_irq->np to the new parent
Date: Tue, 30 Jul 2024 05:02:34 -0000	[thread overview]
Message-ID: <7aef67e6c45c7e91f1da4a9854b2f770.squirrel@_> (raw)

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

Signed-off-by: WHR <whr@rivoreo.one>
---
 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



                 reply	other threads:[~2024-07-30  5:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7aef67e6c45c7e91f1da4a9854b2f770.squirrel@_ \
    --to=whr@rivoreo.one \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=saravanak@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox