Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751979AbdHRJcH (ORCPT ); Fri, 18 Aug 2017 05:32:07 -0400 Received: from terminus.zytor.com ([65.50.211.136]:51401 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750812AbdHRJcG (ORCPT ); Fri, 18 Aug 2017 05:32:06 -0400 Date: Fri, 18 Aug 2017 02:28:49 -0700 From: tip-bot for David Daney Message-ID: Cc: mark.rutland@arm.com, marc.zyngier@arm.com, tglx@linutronix.de, hpa@zytor.com, linus.walleij@linaro.org, david.daney@cavium.com, linux-kernel@vger.kernel.org, gnurou@gmail.com, mingo@kernel.org Reply-To: hpa@zytor.com, marc.zyngier@arm.com, mark.rutland@arm.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, gnurou@gmail.com, mingo@kernel.org, linus.walleij@linaro.org, david.daney@cavium.com In-Reply-To: <1503017616-3252-5-git-send-email-david.daney@cavium.com> References: <1503017616-3252-5-git-send-email-david.daney@cavium.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/core] irqdomain: Check for NULL function pointer in irq_domain_free_irqs_hierarchy() Git-Commit-ID: 0d12ec075a18f53e6f58ec95a4f534da2641bf9b X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1543 Lines: 41 Commit-ID: 0d12ec075a18f53e6f58ec95a4f534da2641bf9b Gitweb: http://git.kernel.org/tip/0d12ec075a18f53e6f58ec95a4f534da2641bf9b Author: David Daney AuthorDate: Thu, 17 Aug 2017 17:53:33 -0700 Committer: Thomas Gleixner CommitDate: Fri, 18 Aug 2017 11:21:42 +0200 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 --- 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 2093b88..24fda75 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,