Skip to content

Commit ad32ab9

Browse files
jgross1KAGA-KOKO
authored andcommitted
irqdomain: Add missing NULL pointer check in irq_domain_create_hierarchy()
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 irqdomain's root will stay to point to itself. Fixes: 9dbb8e3 ("irqdomain: Switch to per-domain locking") Signed-off-by: Juergen Gross <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 5931e4e commit ad32ab9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/irq/irqdomain.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,8 @@ struct irq_domain *irq_domain_create_hierarchy(struct irq_domain *parent,
11721172
domain = __irq_domain_create(fwnode, 0, ~0, 0, ops, host_data);
11731173

11741174
if (domain) {
1175-
domain->root = parent->root;
1175+
if (parent)
1176+
domain->root = parent->root;
11761177
domain->parent = parent;
11771178
domain->flags |= flags;
11781179

0 commit comments

Comments
 (0)