Commit 56d6d1a7 authored by Manish Ahuja's avatar Manish Ahuja Committed by Paul Mackerras

[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: default avatarManish Ahuja <ahuja@austin.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 77926826
...@@ -138,8 +138,8 @@ void __init lmb_analyze(void) ...@@ -138,8 +138,8 @@ void __init lmb_analyze(void)
static long __init lmb_add_region(struct lmb_region *rgn, unsigned long base, static long __init lmb_add_region(struct lmb_region *rgn, unsigned long base,
unsigned long size) unsigned long size)
{ {
unsigned long i, coalesced = 0; unsigned long coalesced = 0;
long adjacent; long adjacent, i;
/* First try and coalesce this LMB with another. */ /* First try and coalesce this LMB with another. */
for (i=0; i < rgn->cnt; i++) { for (i=0; i < rgn->cnt; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment