Skip to content

Commit a581831

Browse files
hbathinimpe
authored andcommitted
powerpc/fadump: cleanup crash memory ranges support
Commit 1bd6a1c ("powerpc/fadump: handle crash memory ranges array index overflow") changed crash memory ranges to a dynamic array that is reallocated on-demand with krealloc(). The relevant header for this call was not included. The kernel compiles though. But be cautious and add the header anyway. Also, memory allocation logic in fadump_add_crash_memory() takes care of memory allocation for crash memory ranges in all scenarios. Drop unnecessary memory allocation in fadump_setup_crash_memory_ranges(). Fixes: 1bd6a1c ("powerpc/fadump: handle crash memory ranges array index overflow") Cc: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> Signed-off-by: Hari Bathini <hbathini@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 95b861a commit a581831

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

arch/powerpc/kernel/fadump.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <linux/crash_dump.h>
3535
#include <linux/kobject.h>
3636
#include <linux/sysfs.h>
37+
#include <linux/slab.h>
3738

3839
#include <asm/debugfs.h>
3940
#include <asm/page.h>
@@ -1019,13 +1020,6 @@ static int fadump_setup_crash_memory_ranges(void)
10191020
pr_debug("Setup crash memory ranges.\n");
10201021
crash_mem_ranges = 0;
10211022

1022-
/* allocate memory for crash memory ranges for the first time */
1023-
if (!max_crash_mem_ranges) {
1024-
ret = allocate_crash_memory_ranges();
1025-
if (ret)
1026-
return ret;
1027-
}
1028-
10291023
/*
10301024
* add the first memory chunk (RMA_START through boot_memory_size) as
10311025
* a separate memory chunk. The reason is, at the time crash firmware

0 commit comments

Comments
 (0)