[PATCH v2 2/3] mfd: mt6397: Checking for null before irq_domain_remove.

Henry Chen henryc.chen at mediatek.com
Thu Apr 7 23:58:48 PDT 2016


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 <henryc.chen at mediatek.com>
---
 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




More information about the linux-arm-kernel mailing list