This seems very reasonable, but if the code is just going to panic if the allocation fails, why not call memblock_alloc_node() instead? If there is a reason we'd prefer to call memblock_alloc_node_nopanic(), I'd like to see pgdat->nodeid printed in the panic message as well.