From: Gyeyoung Baek <gye976@gmail.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org, Gyeyoung Baek <gye976@gmail.com>
Subject: [PATCH] irq: Fix uninitialized pointers
Date: Tue, 27 May 2025 18:35:30 +0900 [thread overview]
Message-ID: <20250527093530.958801-1-gye976@gmail.com> (raw)
Fix uninitialized `ops` member's pointers to avoid kernel Oops in `irq_sim_request_resources()`.
Signed-off-by: Gyeyoung Baek <gye976@gmail.com>
---
kernel/irq/irq_sim.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/kernel/irq/irq_sim.c b/kernel/irq/irq_sim.c
index 1a3d483548e2..67fd1de5d197 100644
--- a/kernel/irq/irq_sim.c
+++ b/kernel/irq/irq_sim.c
@@ -222,8 +222,12 @@ struct irq_domain *irq_domain_create_sim_full(struct fwnode_handle *fwnode,
work_ctx->pending = no_free_ptr(pending);
work_ctx->user_data = data;
- if (ops)
+ if (ops) {
memcpy(&work_ctx->ops, ops, sizeof(*ops));
+ } else {
+ work_ctx->ops.irq_sim_irq_released = NULL;
+ work_ctx->ops.irq_sim_irq_requested = NULL;
+ }
return no_free_ptr(work_ctx)->domain;
}
--
2.43.0
next reply other threads:[~2025-05-27 9:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-27 9:35 Gyeyoung Baek [this message]
2025-06-11 6:39 ` [PATCH] irq: Fix uninitialized pointers Thomas Gleixner
2025-06-12 11:41 ` Gyeyoung Baek
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=20250527093530.958801-1-gye976@gmail.com \
--to=gye976@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.