Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757890AbcDHG76 (ORCPT ); Fri, 8 Apr 2016 02:59:58 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:4288 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S932622AbcDHG7G (ORCPT ); Fri, 8 Apr 2016 02:59:06 -0400 From: Henry Chen To: Lee Jones CC: Matthias Brugger , John Crispin , Sascha Hauer , Flora Fu , , , , Henry Chen Subject: [PATCH v2 2/3] mfd: mt6397: Checking for null before irq_domain_remove. Date: Fri, 8 Apr 2016 14:58:48 +0800 Message-ID: <1460098729-25549-2-git-send-email-henryc.chen@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1460098729-25549-1-git-send-email-henryc.chen@mediatek.com> References: <1460098729-25549-1-git-send-email-henryc.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 717 Lines: 24 It is possible that pmic->irq_domain will be NULL in fail_irq error handling. Check before calling irq_domain_remove. Signed-off-by: Henry Chen --- drivers/mfd/mt6397-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c index a879223..15050cb 100644 --- a/drivers/mfd/mt6397-core.c +++ b/drivers/mfd/mt6397-core.c @@ -312,7 +312,8 @@ static int mt6397_probe(struct platform_device *pdev) fail_irq: if (ret) { - irq_domain_remove(pmic->irq_domain); + if (pmic->irq_domain) + irq_domain_remove(pmic->irq_domain); dev_err(&pdev->dev, "failed to add child devices: %d\n", ret); } -- 1.8.1.1.dirty