]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
gpio: pca953x: Fix uninitialized pending variable
authorYe Li <ye.li@nxp.com>
Wed, 23 Sep 2020 09:03:44 +0000 (02:03 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Oct 2020 06:02:52 +0000 (08:02 +0200)
[ Upstream commit e43c26e12dd49a41cf5a4cd5c5b59a1eb98ed11e ]

When pca953x_irq_pending returns false, the pending parameter won't
be set. But pca953x_irq_handler continues using this uninitialized
variable as pending irqs and will cause problem.
Fix the issue by initializing pending to 0.

Fixes: 064c73afe738 ("gpio: pca953x: Synchronize interrupt handler properly")
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpio/gpio-pca953x.c

index a3b9bdedbe443503778ece0a4f85f4a47187dd6c..cc95f1630feb01a1fac06c5088ba3580d947e915 100644 (file)
@@ -813,7 +813,7 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid)
 {
        struct pca953x_chip *chip = devid;
        struct gpio_chip *gc = &chip->gpio_chip;
-       DECLARE_BITMAP(pending, MAX_LINE);
+       DECLARE_BITMAP(pending, MAX_LINE) = {};
        int level;
        bool ret;