diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ppc64/kernel/prom.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/ppc64/kernel/prom.c b/arch/ppc64/kernel/prom.c index 04b852d446a3..b21848826791 100644 --- a/arch/ppc64/kernel/prom.c +++ b/arch/ppc64/kernel/prom.c | |||
@@ -950,8 +950,13 @@ void __init unflatten_device_tree(void) | |||
950 | DBG(" size is %lx, allocating...\n", size); | 950 | DBG(" size is %lx, allocating...\n", size); |
951 | 951 | ||
952 | /* Allocate memory for the expanded device tree */ | 952 | /* Allocate memory for the expanded device tree */ |
953 | mem = (unsigned long)abs_to_virt(lmb_alloc(size + 4, | 953 | mem = lmb_alloc(size + 4, __alignof__(struct device_node)); |
954 | __alignof__(struct device_node))); | 954 | if (!mem) { |
955 | DBG("Couldn't allocate memory with lmb_alloc()!\n"); | ||
956 | panic("Couldn't allocate memory with lmb_alloc()!\n"); | ||
957 | } | ||
958 | mem = (unsigned long)abs_to_virt(mem); | ||
959 | |||
955 | ((u32 *)mem)[size / 4] = 0xdeadbeef; | 960 | ((u32 *)mem)[size / 4] = 0xdeadbeef; |
956 | 961 | ||
957 | DBG(" unflattening...\n", mem); | 962 | DBG(" unflattening...\n", mem); |