diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2011-09-26 13:16:45 +0900 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2011-09-26 13:17:41 +0900 |
commit | b76f7cdca5af18fa7a59a5c8a9eb5e02418e827a (patch) | |
tree | 251dce7282c2194734719b0802c568a268d31b73 /arch | |
parent | 4344646ff127eaea4d58266ccd8fdd2a38fb9672 (diff) | |
download | linux-b76f7cdca5af18fa7a59a5c8a9eb5e02418e827a.tar.gz linux-b76f7cdca5af18fa7a59a5c8a9eb5e02418e827a.tar.bz2 linux-b76f7cdca5af18fa7a59a5c8a9eb5e02418e827a.zip |
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/plat-s5p/irq-gpioint.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/arm/plat-s5p/irq-gpioint.c b/arch/arm/plat-s5p/irq-gpioint.c index f71078ef6bb5..f88216d23991 100644 --- a/arch/arm/plat-s5p/irq-gpioint.c +++ b/arch/arm/plat-s5p/irq-gpioint.c @@ -114,17 +114,18 @@ static __init int s5p_gpioint_add(struct s3c_gpio_chip *chip) { static int used_gpioint_groups = 0; 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_type *ct; if (used_gpioint_groups >= S5P_GPIOINT_GROUP_COUNT) return -ENOMEM; - list_for_each_entry(bank, &banks, list) { - if (group >= bank->start && - group < bank->start + bank->nr_groups) + list_for_each_entry(b, &banks, list) { + if (group >= b->start && group < b->start + b->nr_groups) { + bank = b; break; + } } if (!bank) return -EINVAL; |