diff options
author | Manish Ahuja <ahuja@austin.ibm.com> | 2007-07-09 15:03:45 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-07-26 02:12:17 -0400 |
commit | 56d6d1a73d9e5ddd9eb1a7baeeda30803ba44879 (patch) | |
tree | ee62e972dd751737d93d7a6d14b908b99067d391 /arch/powerpc | |
parent | 77926826f301fbd8ed96d3cd9ff17a5b59560dfb (diff) |
[POWERPC] Fix loop with unsigned long counter variable
This fixes a possible infinite loop when the unsigned long counter "i"
is used in lmb_add_region() in the following for loop:
for (i = rgn->cnt-1; i >= 0; i--)
by making the loop counter "i" be signed.
Signed-off-by: Manish Ahuja <ahuja@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/mm/lmb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/mm/lmb.c b/arch/powerpc/mm/lmb.c index e3a1e8dc536a..8f4d2dc4cafb 100644 --- a/arch/powerpc/mm/lmb.c +++ b/arch/powerpc/mm/lmb.c | |||
@@ -138,8 +138,8 @@ void __init lmb_analyze(void) | |||
138 | static long __init lmb_add_region(struct lmb_region *rgn, unsigned long base, | 138 | static long __init lmb_add_region(struct lmb_region *rgn, unsigned long base, |
139 | unsigned long size) | 139 | unsigned long size) |
140 | { | 140 | { |
141 | unsigned long i, coalesced = 0; | 141 | unsigned long coalesced = 0; |
142 | long adjacent; | 142 | long adjacent, i; |
143 | 143 | ||
144 | /* First try and coalesce this LMB with another. */ | 144 | /* First try and coalesce this LMB with another. */ |
145 | for (i=0; i < rgn->cnt; i++) { | 145 | for (i=0; i < rgn->cnt; i++) { |