mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] irqdomain: fix regression for Xen guests
@ 2023-02-23  8:38 Juergen Gross
  2023-02-23 14:59 ` [tip: irq/urgent] irqdomain: Add missing NULL pointer check in irq_domain_create_hierarchy() tip-bot2 for Juergen Gross
  2023-02-24 11:24 ` [PATCH] irqdomain: fix regression for Xen guests Johan Hovold
  0 siblings, 2 replies; 3+ messages in thread
From: Juergen Gross @ 2023-02-23  8:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: johan+linaro, Juergen Gross, Marc Zyngier, Thomas Gleixner

The recent switch to per-domain locking caused a NULL dereference in
irq_domain_create_hierarchy(), as Xen code is calling
msi_create_irq_domain() with a NULL parent pointer.

Fix that by testing parent to be set before dereferencing it. For a
non-existing parent the irq-domain's root will stay to point to
itself.

Fixes: 9dbb8e3452ab ("irqdomain: Switch to per-domain locking")
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 kernel/irq/irqdomain.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index aa5b7eeeceb8..6522dfb2e49c 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -1172,7 +1172,8 @@ struct irq_domain *irq_domain_create_hierarchy(struct irq_domain *parent,
 		domain = __irq_domain_create(fwnode, 0, ~0, 0, ops, host_data);
 
 	if (domain) {
-		domain->root = parent->root;
+		if (parent)
+			domain->root = parent->root;
 		domain->parent = parent;
 		domain->flags |= flags;
 
-- 
2.35.3


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

end of thread, other threads:[~2023-02-24 11:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-23  8:38 [PATCH] irqdomain: fix regression for Xen guests Juergen Gross
2023-02-23 14:59 ` [tip: irq/urgent] irqdomain: Add missing NULL pointer check in irq_domain_create_hierarchy() tip-bot2 for Juergen Gross
2023-02-24 11:24 ` [PATCH] irqdomain: fix regression for Xen guests Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®