Commit 71c2742f5e6348d76ee62085cf0a13e5eff0f00e
Committed by
Linus Torvalds
1 parent
a19214430d
Exists in
master
and in
39 other branches
Add return value to reserve_bootmem_node()
This patch changes the function reserve_bootmem_node() from void to int, returning -ENOMEM if the allocation fails. This fixes a build problem on x86 with CONFIG_KEXEC=y and CONFIG_NEED_MULTIPLE_NODES=y Signed-off-by: Bernhard Walle <bwalle@suse.de> Reported-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 2 changed files with 5 additions and 3 deletions Side-by-side Diff
include/linux/bootmem.h
mm/bootmem.c
... | ... | @@ -442,15 +442,17 @@ |
442 | 442 | return init_bootmem_core(pgdat, freepfn, startpfn, endpfn); |
443 | 443 | } |
444 | 444 | |
445 | -void __init reserve_bootmem_node(pg_data_t *pgdat, unsigned long physaddr, | |
445 | +int __init reserve_bootmem_node(pg_data_t *pgdat, unsigned long physaddr, | |
446 | 446 | unsigned long size, int flags) |
447 | 447 | { |
448 | 448 | int ret; |
449 | 449 | |
450 | 450 | ret = can_reserve_bootmem_core(pgdat->bdata, physaddr, size, flags); |
451 | 451 | if (ret < 0) |
452 | - return; | |
452 | + return -ENOMEM; | |
453 | 453 | reserve_bootmem_core(pgdat->bdata, physaddr, size, flags); |
454 | + | |
455 | + return 0; | |
454 | 456 | } |
455 | 457 | |
456 | 458 | void __init free_bootmem_node(pg_data_t *pgdat, unsigned long physaddr, |