sparc: add checks for the return value of memblock_alloc*()
[linux] / arch / sparc / kernel / prom_32.c
index e7126ca..869b16c 100644 (file)
@@ -33,6 +33,8 @@ void * __init prom_early_alloc(unsigned long size)
        void *ret;
 
        ret = memblock_alloc(size, SMP_CACHE_BYTES);
+       if (!ret)
+               panic("%s: Failed to allocate %lu bytes\n", __func__, size);
 
        prom_early_allocated += size;