Skip to content

Commit 71c2742

Browse files
Bernhard Walletorvalds
authored andcommitted
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 <[email protected]> Reported-by: Adrian Bunk <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent a192144 commit 71c2742

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

include/linux/bootmem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ extern unsigned long init_bootmem_node(pg_data_t *pgdat,
9494
unsigned long freepfn,
9595
unsigned long startpfn,
9696
unsigned long endpfn);
97-
extern void reserve_bootmem_node(pg_data_t *pgdat,
97+
extern int reserve_bootmem_node(pg_data_t *pgdat,
9898
unsigned long physaddr,
9999
unsigned long size,
100100
int flags);

mm/bootmem.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,15 +442,17 @@ unsigned long __init init_bootmem_node(pg_data_t *pgdat, unsigned long freepfn,
442442
return init_bootmem_core(pgdat, freepfn, startpfn, endpfn);
443443
}
444444

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,
446446
unsigned long size, int flags)
447447
{
448448
int ret;
449449

450450
ret = can_reserve_bootmem_core(pgdat->bdata, physaddr, size, flags);
451451
if (ret < 0)
452-
return;
452+
return -ENOMEM;
453453
reserve_bootmem_core(pgdat->bdata, physaddr, size, flags);
454+
455+
return 0;
454456
}
455457

456458
void __init free_bootmem_node(pg_data_t *pgdat, unsigned long physaddr,

0 commit comments

Comments
 (0)