From 57a30a41fd5191c6eef3e868e2ae2d365c74b0f2 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Fri, 18 Apr 2014 16:47:30 +0200 Subject: [PATCH] extcon: max14577: Properly handle regmap_irq_get_virq error commit 369afd4ba22f5b8de0c9229b6e62b3f9e2207034 upstream. The regmap_irq_get_virq may return 0 or -EINVAL on error. Fail the probe in both situations. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Chanwoo Choi Signed-off-by: Greg Kroah-Hartman --- drivers/extcon/extcon-max14577.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/extcon/extcon-max14577.c b/drivers/extcon/extcon-max14577.c index 1fef08d..5c948c9 100644 --- a/drivers/extcon/extcon-max14577.c +++ b/drivers/extcon/extcon-max14577.c @@ -650,7 +650,7 @@ static int max14577_muic_probe(struct platform_device *pdev) unsigned int virq = 0; virq = regmap_irq_get_virq(max14577->irq_data, muic_irq->irq); - if (!virq) + if (virq <= 0) return -EINVAL; muic_irq->virq = virq; -- 2.7.4