From: David Daney Date: Fri, 18 Aug 2017 00:53:33 +0000 (-0700) Subject: irqdomain: Check for NULL function pointer in irq_domain_free_irqs_hierarchy() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0d12ec075a18f53e6f58ec95a4f534da2641bf9b;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git irqdomain: Check for NULL function pointer in irq_domain_free_irqs_hierarchy() A follow-on patch will call irq_domain_free_irqs_hierarchy() when the free() function pointer may be NULL. Add a NULL pointer check to handle this new use case. Signed-off-by: David Daney Signed-off-by: Thomas Gleixner Reviewed-by: Marc Zyngier Cc: Mark Rutland Cc: Alexandre Courbot Cc: Linus Walleij Cc: linux-gpio@vger.kernel.org Link: http://lkml.kernel.org/r/1503017616-3252-5-git-send-email-david.daney@cavium.com --- diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 2093b88ce9b7..24fda7557cef 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -1362,7 +1362,8 @@ static void irq_domain_free_irqs_hierarchy(struct irq_domain *domain, unsigned int irq_base, unsigned int nr_irqs) { - domain->ops->free(domain, irq_base, nr_irqs); + if (domain->ops->free) + domain->ops->free(domain, irq_base, nr_irqs); } int irq_domain_alloc_irqs_hierarchy(struct irq_domain *domain,