History

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.

Marek Szyprowski committed 15 years ago

Commit b76f7cd1 parent 43446461 file · +5 −4Browse files

Unified · Split

arch/arm/plat-s5p/irq-gpioint.c+5−4
@@ -114,17 +114,18 @@ static __init int s5p_gpioint_add(struct s3c_gpio_chip *chip) · 113 unmodified lines
114114 {
115115 static int used_gpioint_groups = 0;
116116 int group = chip->group;
117− struct s5p_gpioint_bank *bank = NULL;
117+ struct s5p_gpioint_bank *b, *bank = NULL;
118118 struct irq_chip_generic *gc;
119119 struct irq_chip_type *ct;
120120
121121 if (used_gpioint_groups >= S5P_GPIOINT_GROUP_COUNT)
122122 return -ENOMEM;
123123
124− list_for_each_entry(bank, &banks, list) {
125− if (group >= bank->start &&
126− group < bank->start + bank->nr_groups)
124+ list_for_each_entry(b, &banks, list) {
125+ if (group >= b->start && group < b->start + b->nr_groups) {
126+ bank = b;
127127 break;
128+ }
128129 }
129130 if (!bank)
130131 return -EINVAL;