diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2006-01-25 09:31:26 +0100 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-02-07 11:28:38 +0100 |
commit | 8c20fafa8548917fdbbd95588494498dd901b375 (patch) | |
tree | 37cbfdc145261c0bb292320bbeaa75699942717b /arch/powerpc/mm | |
parent | [PATCH] powerpc: Don't allocate zero bytes in finish_device_tree() (diff) | |
download | linux-8c20fafa8548917fdbbd95588494498dd901b375.tar.xz linux-8c20fafa8548917fdbbd95588494498dd901b375.zip |
[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>
Diffstat (limited to 'arch/powerpc/mm')
-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) { struct lmb_region *_rgn = &(lmb.reserved); + BUG_ON(0 == size); + return lmb_add_region(_rgn, base, size); } @@ -227,6 +229,8 @@ unsigned long __init lmb_alloc_base(unsigned long size, unsigned long align, long i, j; unsigned long base = 0; + BUG_ON(0 == size); + #ifdef CONFIG_PPC32 /* On 32-bit, make sure we allocate lowmem */ if (max_addr == LMB_ALLOC_ANYWHERE) |