]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
extcon: max14577: Properly handle regmap_irq_get_virq error
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>
Fri, 18 Apr 2014 14:47:30 +0000 (16:47 +0200)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 24 Apr 2014 08:26:31 +0000 (17:26 +0900)
The regmap_irq_get_virq may return 0 or -EINVAL on error. Fail the probe
in both situations.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/extcon/extcon-max14577.c

index 4179ce1a23de5f46cf02d7f6cbb9b99151301a1e..2acf7461c905ef420c0b2613e9085c343cd911e7 100644 (file)
@@ -721,7 +721,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;