Input: mt6779-keypad - fix signedness bug
authorLv Ruyi (CGEL ZTE) <lv.ruyi@zte.com.cn>
Tue, 15 Mar 2022 01:12:21 +0000 (18:12 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 15 Mar 2022 01:14:51 +0000 (18:14 -0700)
The irq variable is defined as unsigned int. If the platform_get_irq()
returns a negative value, data type cast may result in error.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi (CGEL ZTE) <lv.ruyi@zte.com.cn>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20220308025054.2077162-1-lv.ruyi@zte.com.cn
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/keyboard/mt6779-keypad.c

index 5ff2325..0dbbddc 100644 (file)
@@ -91,7 +91,7 @@ static void mt6779_keypad_clk_disable(void *data)
 static int mt6779_keypad_pdrv_probe(struct platform_device *pdev)
 {
        struct mt6779_keypad *keypad;
-       unsigned int irq;
+       int irq;
        u32 debounce;
        bool wakeup;
        int error;