Input: ep93xx_keypad - fix handling of platform_get_irq() error
authorKrzysztof Kozlowski <krzk@kernel.org>
Wed, 16 Sep 2020 00:51:05 +0000 (17:51 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 08:05:40 +0000 (09:05 +0100)
[ Upstream commit 7d50f6656dacf085a00beeedbc48b19a37d17881 ]

platform_get_irq() returns -ERRNO on error.  In such case comparison
to 0 would pass the check.

Fixes: 60214f058f44 ("Input: ep93xx_keypad - update driver to new core support")
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200828145744.3636-1-krzk@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/input/keyboard/ep93xx_keypad.c

index f77b295e0123e9438ada601a70e0b530804c4c30..01788a78041b3cfa3ed7bbdac5d0092373b4f10f 100644 (file)
@@ -257,8 +257,8 @@ static int ep93xx_keypad_probe(struct platform_device *pdev)
        }
 
        keypad->irq = platform_get_irq(pdev, 0);
-       if (!keypad->irq) {
-               err = -ENXIO;
+       if (keypad->irq < 0) {
+               err = keypad->irq;
                goto failed_free;
        }