diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2007-11-05 05:10:11 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-11-05 05:10:17 -0500 |
commit | 0b8da654b6c13b40b0e0efd916ee57ed13f9fa1f (patch) | |
tree | 31a302d2f92bc451dfa4fea433f8683495b13f4b /arch | |
parent | 0d2be08893605be00de0f95ee7e4b8917ea1ebc3 (diff) |
[S390] Fix memory detection.
Yet another patch in the countless series of memory detection fixes:
if the last area of the reported storage size is a hole the detection
loop will loop forever.
Just break chunk detection loop if its end is going to be larger than
reported storage size.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/kernel/early.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c index e6289ee74ecd..8bf4ae1150be 100644 --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c | |||
@@ -200,11 +200,13 @@ static noinline __init void find_memory_chunks(unsigned long memsize) | |||
200 | cc = __tprot(addr); | 200 | cc = __tprot(addr); |
201 | while (cc == old_cc) { | 201 | while (cc == old_cc) { |
202 | addr += CHUNK_INCR; | 202 | addr += CHUNK_INCR; |
203 | cc = __tprot(addr); | 203 | if (addr >= memsize) |
204 | break; | ||
204 | #ifndef CONFIG_64BIT | 205 | #ifndef CONFIG_64BIT |
205 | if (addr == ADDR2G) | 206 | if (addr == ADDR2G) |
206 | break; | 207 | break; |
207 | #endif | 208 | #endif |
209 | cc = __tprot(addr); | ||
208 | } | 210 | } |
209 | 211 | ||
210 | if (old_addr != addr && | 212 | if (old_addr != addr && |