OpenCloudOS-Kernel/arch/arm64/kernel
Mike Rapoport 8a7f97b902 treewide: add checks for the return value of memblock_alloc*()
Add check for the return value of memblock_alloc*() functions and call
panic() in case of error.  The panic message repeats the one used by
panicing memblock allocators with adjustment of parameters to include
only relevant ones.

The replacement was mostly automated with semantic patches like the one
below with manual massaging of format strings.

  @@
  expression ptr, size, align;
  @@
  ptr = memblock_alloc(size, align);
  + if (!ptr)
  + 	panic("%s: Failed to allocate %lu bytes align=0x%lx\n", __func__, size, align);

[anders.roxell@linaro.org: use '%pa' with 'phys_addr_t' type]
  Link: http://lkml.kernel.org/r/20190131161046.21886-1-anders.roxell@linaro.org
[rppt@linux.ibm.com: fix format strings for panics after memblock_alloc]
  Link: http://lkml.kernel.org/r/1548950940-15145-1-git-send-email-rppt@linux.ibm.com
[rppt@linux.ibm.com: don't panic if the allocation in sparse_buffer_init fails]
  Link: http://lkml.kernel.org/r/20190131074018.GD28876@rapoport-lnx
[akpm@linux-foundation.org: fix xtensa printk warning]
Link: http://lkml.kernel.org/r/1548057848-15136-20-git-send-email-rppt@linux.ibm.com
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Reviewed-by: Guo Ren <ren_guo@c-sky.com>		[c-sky]
Acked-by: Paul Burton <paul.burton@mips.com>		[MIPS]
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>	[s390]
Reviewed-by: Juergen Gross <jgross@suse.com>		[Xen]
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>	[m68k]
Acked-by: Max Filippov <jcmvbkbc@gmail.com>		[xtensa]
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Christoph Hellwig <hch@lst.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Dennis Zhou <dennis@kernel.org>
Cc: Greentime Hu <green.hu@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Cc: Guo Ren <guoren@kernel.org>
Cc: Mark Salter <msalter@redhat.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Rich Felker <dalias@libc.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-03-12 10:04:02 -07:00
..
probes arm64 updates for 5.1: 2019-03-10 10:17:23 -07:00
vdso arm64: Add build salt to the vDSO 2018-07-18 01:18:05 +09:00
.gitignore arm64: Build infrastructure 2012-09-17 13:42:21 +01:00
Makefile arm64: replace arm64-obj-* in Makefile with obj-* 2019-01-04 10:09:21 +00:00
acpi.c arm64: KVM/mm: Move SEA handling behind a single 'claim' interface 2019-02-07 23:10:45 +01:00
acpi_numa.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
acpi_parking_protocol.c arm64: fix endianness annotation in acpi_parking_protocol.c 2017-06-29 11:33:15 +01:00
alternative.c arm64: alternative: Apply alternatives early in boot process 2019-02-06 10:05:20 +00:00
armv8_deprecated.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
asm-offsets.c arm64: Make PMR part of task context 2019-02-06 10:05:18 +00:00
cacheinfo.c arm64: Add support for ACPI based firmware tables 2018-05-17 17:28:09 +01:00
cpu-reset.S arm64: kexec_file: invoke the kernel without purgatory 2018-12-06 14:38:53 +00:00
cpu-reset.h arm64: kexec: always reset to EL2 if present 2018-07-04 18:34:24 +01:00
cpu_errata.c arm64: kpti: Avoid rewriting early page tables when KASLR is enabled 2019-01-10 17:49:35 +00:00
cpu_ops.c arm64: cpu_ops: Add missing 'const' qualifiers 2017-12-01 13:05:08 +00:00
cpufeature.c arm64: Enable the support of pseudo-NMIs 2019-02-06 10:06:41 +00:00
cpuidle.c ARM64 / cpuidle: Use new cpuidle macro for entering retention state 2018-01-02 13:50:34 +00:00
cpuinfo.c arm64: add basic pointer authentication support 2018-12-13 16:42:46 +00:00
crash_core.c arm64: kernel: arch_crash_save_vmcoreinfo() should depend on CONFIG_CRASH_CORE 2018-09-11 11:08:49 +01:00
crash_dump.c arm64: kdump: fix small typo 2018-11-02 17:24:17 +00:00
debug-monitors.c signal/arm64: Add and use arm64_force_sig_fault where appropriate 2018-09-27 21:54:43 +02:00
efi-entry.S arm64: Add software workaround for Falkor erratum 1041 2018-02-06 22:53:13 +00:00
efi-header.S arm64: efi: split Image code and data into separate PE/COFF sections 2017-04-04 17:50:59 +01:00
efi-rt-wrapper.S efi/arm64: Check whether x18 is preserved by runtime services calls 2018-03-09 08:58:22 +01:00
efi.c efi/arm64: Check whether x18 is preserved by runtime services calls 2018-03-09 08:58:22 +01:00
entry-fpsimd.S arm64/sve: Write ZCR_EL1 on context switch only if changed 2018-05-17 18:19:53 +01:00
entry-ftrace.S arm64: frace: use asm EXPORT_SYMBOL() 2018-12-10 11:50:12 +00:00
entry.S arm64: Rename get_thread_info() 2019-02-26 16:57:59 +00:00
fpsimd.c signal/arm64: Use send_sig_fault where appropriate 2018-09-27 21:55:23 +02:00
ftrace.c Tracing changes for v4.21: 2018-12-31 11:46:59 -08:00
head.S arm64: Relax GIC version check during early boot 2019-02-20 14:05:37 +00:00
hibernate-asm.S arm64: mm: Offset TTBR1 to allow 52-bit PTRS_PER_PGD 2018-12-10 18:42:17 +00:00
hibernate.c arm64: hibernate: Clean the __hyp_text to PoC after resume 2019-02-01 14:10:02 +00:00
hw_breakpoint.c perf/arch/arm64: Implement hw_breakpoint_arch_parse() 2018-06-26 09:07:56 +02:00
hyp-stub.S arm64: hyp-stub: Forbid kprobing of the hyp-stub 2019-02-01 14:10:01 +00:00
image.h Merge branch 'for-next/kexec' into aarch64/for-next/core 2018-12-10 18:57:17 +00:00
insn.c arm64/insn: add support for emitting ADR/ADRP instructions 2018-11-27 18:47:33 +00:00
io.c arm64: Avoid aligning normal memory pointers in __memcpy_{to,from}io 2017-10-24 16:23:07 +01:00
irq.c arm64: Fix HCR.TGE status for NMI contexts 2019-02-06 10:05:16 +00:00
jump_label.c jump_label: move 'asm goto' support test to Kconfig 2019-01-06 09:46:51 +09:00
kaslr.c arm64: kaslr: ensure randomized quantities are clean also when kaslr is off 2019-02-01 14:07:23 +00:00
kexec_image.c arm64: kexec_file: forbid kdump via kexec_file_load() 2018-12-07 15:28:21 +00:00
kgdb.c arm64: debug: Ensure debug handlers check triggering exception level 2019-03-01 16:23:38 +00:00
kuser32.S arm64: Add __NR_* definitions for compat syscalls 2014-07-10 11:02:40 +01:00
machine_kexec.c arm64: kdump: no need to mark crashkernel pages manually PG_reserved 2019-03-05 21:07:19 -08:00
machine_kexec_file.c arm64: kexec_file: handle empty command-line 2019-02-05 09:34:49 +00:00
module-plts.c arm64/module: switch to ADRP/ADD sequences for PLT entries 2018-11-27 19:00:45 +00:00
module.c arm64/module: switch to ADRP/ADD sequences for PLT entries 2018-11-27 19:00:45 +00:00
module.lds arm64: ftrace: emit ftrace-mod.o contents through code 2017-12-01 13:04:59 +00:00
paravirt.c x86/paravirt: Use a single ops structure 2018-09-03 16:50:35 +02:00
pci.c arm64: PCI: Remove node-local allocations when initialising host controller 2018-09-17 16:33:23 -05:00
perf_callchain.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
perf_event.c arm64: perf: remove misleading comment 2019-01-19 22:57:38 +00:00
perf_regs.c compat: Move compat_timespec/ timeval to compat_time.h 2018-04-19 13:29:54 +02:00
pointer_auth.c arm64: ptr auth: Move per-thread keys from thread_info to thread_struct 2018-12-13 16:42:47 +00:00
process.c arm64: Unmask PMR before going idle 2019-02-06 10:05:18 +00:00
psci.c arm64: remove unused asm/compiler.h header file 2018-10-01 11:57:04 +01:00
ptrace.c arm64 updates for 5.1: 2019-03-10 10:17:23 -07:00
reloc_test_core.c arm64: fix undefined reference to 'printk' 2018-03-19 18:14:25 +00:00
reloc_test_syms.S arm64: fix undefined reference to 'printk' 2018-03-19 18:14:25 +00:00
relocate_kernel.S arm64: kexec_file: invoke the kernel without purgatory 2018-12-06 14:38:53 +00:00
return_address.c arm64: Use ftrace_graph_get_ret_stack() instead of curr_ret_stack 2018-12-22 08:21:02 -05:00
sdei.c arm64: sdei: Mark sdei stack helper functions as static 2018-07-31 12:08:22 +01:00
setup.c treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
signal.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
signal32.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
sleep.S arm64/mm: Pass ttbr1 as a parameter to __enable_mmu() 2018-09-25 15:10:54 +01:00
smccc-call.S arm64: smccc: use asm EXPORT_SYMBOL() 2018-12-10 11:50:11 +00:00
smp.c arm64: Switch to PMR masking when starting CPUs 2019-02-06 10:05:20 +00:00
smp_spin_table.c arm64: Use __pa_symbol for kernel symbols 2017-01-12 15:05:39 +00:00
ssbd.c arm64: ssbd: Add support for PSTATE.SSBS rather than trapping to EL3 2018-09-14 17:46:19 +01:00
stacktrace.c arm64: Use ftrace_graph_get_ret_stack() instead of curr_ret_stack 2018-12-22 08:21:02 -05:00
suspend.c arm64: mm: Support Common Not Private translations 2018-09-18 12:02:27 +01:00
sys.c arm64: implement syscall wrappers 2018-07-12 14:49:48 +01:00
sys32.c arm64: implement syscall wrappers 2018-07-12 14:49:48 +01:00
sys_compat.c arm64 fixes for -rc1 2019-01-05 11:28:39 -08:00
syscall.c arm64: compat: Don't pull syscall number from regs in arm_compat_syscall 2019-01-04 14:18:01 +00:00
time.c arm64: Use ftrace_graph_get_ret_stack() instead of curr_ret_stack 2018-12-22 08:21:02 -05:00
topology.c arm64: topology: re-introduce numa mask check for scheduler MC selection 2018-07-06 13:18:18 +01:00
trace-events-emulation.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
traps.c arm64: Handle serror in NMI context 2019-02-06 10:05:22 +00:00
vdso.c arm64/vdso: Support mremap() for vDSO 2017-08-09 12:16:28 +01:00
vmlinux.lds.S arm64: relocatable: fix inconsistencies in linker script and options 2018-12-04 12:48:25 +00:00