diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2006-01-25 03:31:26 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-02-07 05:28:38 -0500 |
commit | 8c20fafa8548917fdbbd95588494498dd901b375 (patch) | |
tree | 37cbfdc145261c0bb292320bbeaa75699942717b | |
parent | fa93895329b87112cb1fd784db969e60b5b46af6 (diff) |
[PATCH] powerpc: Make sure we don't create empty lmb regions
To prevent problems later in boot, make sure we don't create zero-size lmb
regions.
I've checked all the callers, and at the moment no one should ever hit this.
All callers use a constant size, or they check the computed size before they
call us.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/mm/lmb.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/mm/lmb.c b/arch/powerpc/mm/lmb.c index 9584608fd768..bbe3eac918e8 100644 --- a/arch/powerpc/mm/lmb.c +++ b/arch/powerpc/mm/lmb.c | |||
@@ -197,6 +197,8 @@ long __init lmb_reserve(unsigned long base, unsigned long size) | |||
197 | { | 197 | { |
198 | struct lmb_region *_rgn = &(lmb.reserved); | 198 | struct lmb_region *_rgn = &(lmb.reserved); |
199 | 199 | ||
200 | BUG_ON(0 == size); | ||
201 | |||
200 | return lmb_add_region(_rgn, base, size); | 202 | return lmb_add_region(_rgn, base, size); |
201 | } | 203 | } |
202 | 204 | ||
@@ -227,6 +229,8 @@ unsigned long __init lmb_alloc_base(unsigned long size, unsigned long align, | |||
227 | long i, j; | 229 | long i, j; |
228 | unsigned long base = 0; | 230 | unsigned long base = 0; |
229 | 231 | ||
232 | BUG_ON(0 == size); | ||
233 | |||
230 | #ifdef CONFIG_PPC32 | 234 | #ifdef CONFIG_PPC32 |
231 | /* On 32-bit, make sure we allocate lowmem */ | 235 | /* On 32-bit, make sure we allocate lowmem */ |
232 | if (max_addr == LMB_ALLOC_ANYWHERE) | 236 | if (max_addr == LMB_ALLOC_ANYWHERE) |