irq: Fix possible null pointer dereference on domains with no ops
Subsystems (2)
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().
Signed-off-by Mark Brown <[email protected]>
--- kernel/irq/irqdomain.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/irq/irqdomain.c +1 -1
@@ -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