Linux GPIO subsystem development
 help / color / mirror / Atom feed
* [PATCH] gpio: pca953x: Fix uninitialized pending variable
@ 2020-09-23  9:03 Ye Li
  2020-09-23 10:38 ` Andy Shevchenko
  2020-09-24 13:07 ` Bartosz Golaszewski
  0 siblings, 2 replies; 3+ messages in thread
From: Ye Li @ 2020-09-23  9:03 UTC (permalink / raw)
  To: linus.walleij, bgolaszewski, andriy.shevchenko; +Cc: linux-gpio

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>
---
 drivers/gpio/gpio-pca953x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index b5c3e566..0a49ab6 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -814,7 +814,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;
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-24 13:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-23  9:03 [PATCH] gpio: pca953x: Fix uninitialized pending variable Ye Li
2020-09-23 10:38 ` Andy Shevchenko
2020-09-24 13:07 ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox