1
0
Fork 0
alistair23-linux/arch/s390/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
..
syscalls y2038: add 64-bit time_t syscalls to all 32-bit architectures 2019-02-07 00:13:28 +01:00
vdso32 s390/vdso: add missing FORCE to build targets 2018-10-26 10:19:40 +02:00
vdso64 s390/vdso: add missing FORCE to build targets 2018-10-26 10:19:40 +02:00
.gitignore s390: add various .gitignore files. 2012-05-16 14:42:41 +02:00
Makefile s390/cpum_cf_diag: Add support for s390 counter facility diagnostic trace 2019-02-22 09:19:56 +01:00
alternative.c s390: add automatic detection of the spectre defense 2018-03-28 08:38:24 +02:00
asm-offsets.c s390: add support for virtually mapped kernel stacks 2018-10-09 11:20:57 +02:00
audit.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
audit.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
base.S s390: add support for virtually mapped kernel stacks 2018-10-09 11:20:57 +02:00
cache.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
compat_audit.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
compat_linux.c s390: use generic UID16 implementation 2019-01-18 09:33:18 +01:00
compat_linux.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
compat_ptrace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
compat_signal.c s390/compat: fix setup_frame32 2018-04-10 07:38:54 +02:00
cpcmd.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
crash_dump.c memblock: memblock_phys_alloc(): don't panic 2019-03-12 10:04:01 -07:00
debug.c s390: no need to check return value of debugfs_create functions 2019-01-28 15:58:55 +01:00
diag.c s390/setup: set control program code via diag 318 2019-01-28 15:58:53 +01:00
dis.c s390: kernel: add SPDX identifiers to the remaining files 2017-11-24 15:37:12 +01:00
dumpstack.c s390/dumpstack: print psw mask and address again 2018-10-10 07:37:20 +02:00
early.c s390 updates for the 5.1 merge window 2019-03-05 11:13:10 -08:00
early_nobss.c s390/kasan: add initialization code and enable it 2018-10-09 11:21:20 +02:00
early_printk.c s390/hibernate: fix error handling when suspend cpu != resume cpu 2018-09-20 13:20:23 +02:00
ebcdic.c s390: ebcdic: convert comments to UTF-8 2018-08-23 18:48:43 -07:00
entry.S s390: autogenerate compat syscall wrappers 2019-01-18 09:33:19 +01:00
entry.h s390: add support for virtually mapped kernel stacks 2018-10-09 11:20:57 +02:00
fpu.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ftrace.c s390/function_graph: Simplify with function_graph_enter() 2018-11-27 20:31:30 -05:00
guarded_storage.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2017-11-13 11:47:01 -08:00
head64.S s390: remove dead code 2019-02-07 11:56:57 +01:00
idle.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ipl.c s390/kasan: reipl and kexec support 2018-10-09 11:21:27 +02:00
ipl_vmparm.c s390: move ipl block and cmd line handling to early boot phase 2018-10-09 11:21:14 +02:00
irq.c s390: unify stack size definitions 2018-10-09 11:20:58 +02:00
jump_label.c jump_label: move 'asm goto' support test to Kconfig 2019-01-06 09:46:51 +09:00
kdebugfs.c s390: no need to check return value of debugfs_create functions 2019-01-28 15:58:55 +01:00
kexec_elf.c s390/kexec_file: Add ELF loader 2018-04-16 09:10:23 +02:00
kexec_image.c s390/kexec_file: Add crash support to image loader 2018-04-16 09:10:22 +02:00
kprobes.c bpf/error-inject/kprobes: Clear current_kprobe and enable preempt in kprobe 2018-06-21 12:33:19 +02:00
lgr.c s390: kernel: add SPDX identifiers to the remaining files 2017-11-24 15:37:12 +01:00
machine_kexec.c s390: add support for virtually mapped kernel stacks 2018-10-09 11:20:57 +02:00
machine_kexec_file.c s390, kexec_file: drop arch_kexec_mem_walk() 2018-12-06 14:38:49 +00:00
mcount.S s390/ftrace: Add -mfentry and -mnop-mcount support 2018-08-15 22:39:53 -04:00
module.c s390/kasan: dynamic shadow mem allocation for modules 2018-10-09 11:21:23 +02:00
nmi.c headers: untangle kmemleak.h from mm.h 2018-04-05 21:36:27 -07:00
nospec-branch.c s390: detect etoken facility 2018-07-18 08:32:17 +02:00
nospec-sysfs.c s390: detect etoken facility 2018-07-18 08:32:17 +02:00
os_info.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf_cpum_cf.c s390/cpum_cf: Handle EBUSY return code from CPU counter facility reservation 2019-02-22 09:19:58 +01:00
perf_cpum_cf_common.c s390/cpum_cf: move common functions into a separate file 2019-02-22 09:19:55 +01:00
perf_cpum_cf_diag.c s390/cpum_cf_diag: Add support for s390 counter facility diagnostic trace 2019-02-22 09:19:56 +01:00
perf_cpum_cf_events.c s390/cpum_cf: move counter set controls to a new header file 2019-02-22 09:19:46 +01:00
perf_cpum_sf.c perf/aux: Make perf_event accessible to setup_aux() 2019-02-06 10:00:39 -03:00
perf_event.c s390: kernel: Remove redundant license text 2017-11-24 15:37:20 +01:00
perf_regs.c s390/perf: fix gcc 8 array-bounds warning 2018-07-02 11:24:54 +02:00
pgm_check.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
process.c s390: update sampling tag after task pid change 2018-04-23 07:57:17 +02:00
processor.c s390: run user space and KVM guests with modified branch prediction 2018-02-05 14:48:50 +01:00
ptrace.c s390/gs: add compat regset for the guarded storage broadcast control block 2017-11-28 17:33:15 +01:00
reipl.S s390/kernel: use expoline for indirect branches 2018-05-07 21:12:39 +02:00
relocate_kernel.S s390: assume diag308 set always works 2018-04-10 07:38:59 +02:00
runtime_instr.c s390/runtime_instrumentation: re-add signum system call parameter 2018-02-05 07:34:50 +01:00
setup.c treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
signal.c s390: wire up rseq system call 2018-07-04 08:35:18 +02:00
smp.c treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
stacktrace.c s390: kernel: add SPDX identifiers to the remaining files 2017-11-24 15:37:12 +01:00
sthyi.c s390/sthyi: Fix machine name validity indication 2018-10-15 12:17:00 +02:00
suspend.c s390: unify linker symbols usage 2018-02-27 08:05:23 +01:00
swsusp.S s390 updates for the 5.1 merge window 2019-03-05 11:13:10 -08:00
sys_s390.c s390: autogenerate compat syscall wrappers 2019-01-18 09:33:19 +01:00
sysinfo.c s390: no need to check return value of debugfs_create functions 2019-01-28 15:58:55 +01:00
time.c s390/time: Remove read_boot_clock64() 2018-07-20 00:02:41 +02:00
topology.c treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
trace.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
traps.c signal/s390: Use force_sig_fault where appropriate 2018-04-25 10:44:08 -05:00
uprobes.c s390/uprobes: implement arch_uretprobe_is_alive() 2018-04-23 07:57:16 +02:00
vdso.c s390/vdso: don't clear PG_reserved 2019-03-05 21:07:18 -08:00
vmlinux.lds.S s390: avoid vmlinux segments overlap 2018-10-26 10:19:40 +02:00
vtime.c s390/cpu_mf: replace stcctm5() with the stcctm() function 2019-02-22 09:19:53 +01:00