[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1513871710-13765-1-git-send-email-gomonovych@gmail.com>
Date: Thu, 21 Dec 2017 16:55:10 +0100
From: Vasyl Gomonovych <gomonovych@...il.com>
To: joel@....id.au, linus.walleij@...aro.org,
linux-gpio@...r.kernel.org, gomonovych@...il.com
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH] gpio: fix aspeed_gpio_banks array size check
The test should be >= ARRAY_SIZE() instead of > ARRAY_SIZE().
Signed-off-by: Vasyl Gomonovych <gomonovych@...il.com>
---
drivers/gpio/gpio-aspeed.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c
index 6b3ca6601af2..aac532837b81 100644
--- a/drivers/gpio/gpio-aspeed.c
+++ b/drivers/gpio/gpio-aspeed.c
@@ -140,7 +140,7 @@ static const struct aspeed_gpio_bank *to_bank(unsigned int offset)
{
unsigned int bank = GPIO_BANK(offset);
- WARN_ON(bank > ARRAY_SIZE(aspeed_gpio_banks));
+ WARN_ON(bank >= ARRAY_SIZE(aspeed_gpio_banks));
return &aspeed_gpio_banks[bank];
}
--
1.9.1
Powered by blists - more mailing lists