ARM: S5P: fix incorrect loop iterator usage on gpio-interrupt
Loop iterator value after terminating list_for_each_entry() is not NULL. This patch fixes incorrect iterator usage in GPIO interrupt code for SAMSUNG S5P platforms. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
This commit is contained in:
committed by
Kukjin Kim
parent
4344646ff1
commit
b76f7cdca5
@@ -114,17 +114,18 @@ static __init int s5p_gpioint_add(struct s3c_gpio_chip *chip)
|
|||||||
{
|
{
|
||||||
static int used_gpioint_groups = 0;
|
static int used_gpioint_groups = 0;
|
||||||
int group = chip->group;
|
int group = chip->group;
|
||||||
struct s5p_gpioint_bank *bank = NULL;
|
struct s5p_gpioint_bank *b, *bank = NULL;
|
||||||
struct irq_chip_generic *gc;
|
struct irq_chip_generic *gc;
|
||||||
struct irq_chip_type *ct;
|
struct irq_chip_type *ct;
|
||||||
|
|
||||||
if (used_gpioint_groups >= S5P_GPIOINT_GROUP_COUNT)
|
if (used_gpioint_groups >= S5P_GPIOINT_GROUP_COUNT)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
list_for_each_entry(bank, &banks, list) {
|
list_for_each_entry(b, &banks, list) {
|
||||||
if (group >= bank->start &&
|
if (group >= b->start && group < b->start + b->nr_groups) {
|
||||||
group < bank->start + bank->nr_groups)
|
bank = b;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!bank)
|
if (!bank)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
Reference in New Issue
Block a user