Skip to contentSkip to conversation

irq: Fix possible null pointer dereference on domains with no ops

PATCH New Mark Brown 1 participant 1 message Nov 23, 2011

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 irq: Fix possible null pointer dereference on domains with no ops

It is optional for irqdomains to have operations so we need to check for their presence before dereferencing them when looking for dt_translate().

---
 kernel/irq/irqdomain.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/irq/irqdomain.c +1 -1
index 200ce83..b22a641 100644
@@ -89,7 +89,7 @@ unsigned int irq_create_of_mapping(struct device_node *controller,
 	/* Find a domain which can translate the irq spec */
 	mutex_lock(&irq_domain_mutex);
 	list_for_each_entry(domain, &irq_domain_list, list) {
-		if (!domain->ops->dt_translate)
+		if (!domain->ops || !domain->ops->dt_translate)
 			continue;
 		rc = domain->ops->dt_translate(domain, controller,
 					intspec, intsize, &hwirq, &type);
Signature · 1 line
1.7.7.3