1
0
Fork 0
alistair23-linux/arch/arm/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
..
.gitignore
Makefile ARM: bugs: prepare processor bug infrastructure 2018-05-31 10:39:18 +01:00
arch_timer.c arch_timer: Move to generic sched_clock framework 2013-10-09 16:54:10 -07:00
armksyms.c ARM: 8788/1: ftrace: remove old mcount support 2018-09-19 10:44:50 +01:00
asm-offsets.c ARM: smp: add support for per-task stack canaries 2018-12-12 13:20:07 -08:00
atags.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
atags_compat.c ARM: convert printk(KERN_* to pr_* 2014-11-21 15:24:50 +00:00
atags_parse.c vfs: Suppress MS_* flag defs within the kernel unless explicitly enabled 2018-12-20 16:32:56 +00:00
atags_proc.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bios32.c PCI: Remove PCI_REASSIGN_ALL_RSRC use on arm and arm64 2017-12-18 23:07:43 -06:00
bugs.c ARM: clean up per-processor check_bugs method call 2018-11-12 10:51:01 +00:00
cpuidle.c ARM: Convert to using %pOF instead of full_name 2017-08-16 22:25:30 +02:00
crash_dump.c ARM: 8012/1: kdump: Avoid overflow when converting pfn to physaddr 2014-04-07 12:10:00 +01:00
debug.S Merge branches 'fixes', 'misc' and 'sa1111-for-next' into for-next 2017-11-08 19:42:43 +00:00
devtree.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
dma-isa.c ARM: convert printk(KERN_* to pr_* 2014-11-21 15:24:50 +00:00
dma.c proc: introduce proc_create_single{,_data} 2018-05-16 07:23:35 +02:00
early_printk.c ARM: 8705/1: early_printk: use printascii() rather than printch() 2017-10-12 11:29:29 +01:00
efi.c ARM/efi: Apply strict permissions for UEFI Runtime Services regions 2016-04-28 11:33:53 +02:00
elf.c Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm 2017-11-16 12:50:35 -08:00
entry-armv.S ARM: Convert to GENERIC_IRQ_MULTI_HANDLER 2018-08-03 12:14:08 +02:00
entry-common.S ARM: 8802/1: Call syscall_trace_exit even when system call skipped 2018-10-10 13:53:12 +01:00
entry-ftrace.S ARM: 8788/1: ftrace: remove old mcount support 2018-09-19 10:44:50 +01:00
entry-header.S ARM: spectre-v1: fix syscall entry 2018-05-31 23:27:26 +01:00
entry-v7m.S ARM: rename S_FRAME_SIZE to PT_REGS_SIZE 2016-06-22 19:54:28 +01:00
fiq.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fiqasm.S ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ 2014-07-18 12:29:04 +01:00
ftrace.c ARM: function_graph: Simplify with function_graph_enter() 2018-11-27 20:29:52 -05:00
head-common.S ARM: make lookup_processor_type() non-__init 2018-11-12 10:51:01 +00:00
head-inflate-data.c ARM: XIP kernel: store .data compressed in ROM 2017-09-10 19:34:53 -04:00
head-nommu.S Merge branches 'fixes', 'misc' and 'spectre' into for-linus 2018-08-13 16:28:50 +01:00
head.S ARM: 8811/1: always list both ldrd/strd registers explicitly 2018-11-12 10:51:54 +00:00
hibernate.c ARM: use virt_to_idmap() for soft_restart() 2016-02-08 15:48:32 +00:00
hw_breakpoint.c perf/arch/arm: Implement hw_breakpoint_arch_parse() 2018-06-26 09:07:56 +02:00
hyp-stub.S ARM: align .data section 2017-08-14 16:22:55 +01:00
insn.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
io.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
irq.c ARM: 8824/1: fix a migrating irq bug when hotplug cpu 2019-02-01 21:54:49 +00:00
isa.c arm: convert use of typedef ctl_table to struct ctl_table 2014-06-06 16:08:15 -07:00
iwmmxt.S ARM: align .data section 2017-08-14 16:22:55 +01:00
jump_label.c jump_label: move 'asm goto' support test to Kconfig 2019-01-06 09:46:51 +09:00
kgdb.c kgdb/treewide: constify struct kgdb_arch arch_kgdb_ops 2018-12-30 08:33:06 +00:00
machine_kexec.c ARM: kexec: record parent context registers for non-crash CPUs 2018-05-19 11:35:56 +01:00
module-plts.c ARM: 8662/1: module: split core and init PLT sections 2017-03-17 10:01:28 +00:00
module.c ARM: Silence first allocation with CONFIG_ARM_MODULE_PLTS=y 2017-05-11 14:43:31 +01:00
module.lds License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
opcodes.c
paravirt.c x86/paravirt: Use a single ops structure 2018-09-03 16:50:35 +02:00
patch.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf_callchain.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
perf_event_v6.c arm_pmu: Tidy up clear_event_idx call backs 2018-07-10 18:19:02 +01:00
perf_event_v7.c arm_pmu: Tidy up clear_event_idx call backs 2018-07-10 18:19:02 +01:00
perf_event_xscale.c arm_pmu: Tidy up clear_event_idx call backs 2018-07-10 18:19:02 +01:00
perf_regs.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pj4-cp0.c ARM: 8452/3: PJ4: make coprocessor access sequences buildable in Thumb2 mode 2016-01-04 11:12:10 +00:00
process.c get rid of legacy 'get_ds()' function 2019-03-04 10:50:14 -08:00
psci_smp.c ARM: use const and __initconst for smp_operations 2015-12-01 22:17:45 +01:00
ptrace.c signal/arm: Use force_sig_fault where appropriate 2018-09-27 21:57:39 +02:00
reboot.c ARM: soft-reboot into same mode that we entered the kernel 2017-04-09 07:49:24 -07:00
reboot.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
relocate_kernel.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
return_address.c ARM: 8328/1: remove empty preprocessor #else branch 2015-03-28 16:54:53 +00: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
signal.h ARM: signal handling support for FDPIC_FUNCPTRS functions 2017-09-10 19:31:46 -04:00
sigreturn_codes.S ARM: signal handling support for FDPIC_FUNCPTRS functions 2017-09-10 19:31:46 -04:00
sleep.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
smccc-call.S arm: kernel: Add SMC structure parameter 2017-02-03 18:46:33 +00:00
smp.c ARM: 8824/1: fix a migrating irq bug when hotplug cpu 2019-02-01 21:54:49 +00:00
smp_scu.c ARM: smp_scu: allow the platform code to read the SCU CPU status 2017-10-29 08:29:30 -07:00
smp_tlb.c ARM: 8613/1: Fix the uaccess crash on PB11MPCore 2017-01-16 17:30:46 +00:00
smp_twd.c clocksource/drivers: Rename CLOCKSOURCE_OF_DECLARE to TIMER_OF_DECLARE 2017-06-14 11:58:45 +02:00
stacktrace.c ARM: probes: avoid adding kprobes to sensitive kernel-entry/exit code 2017-12-17 22:14:21 +00:00
suspend.c ARM: bugs: hook processor bug checking into SMP and suspend paths 2018-05-31 10:39:29 +01:00
swp_emulate.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
sys_arm.c mm: add ksys_fadvise64_64() helper; remove in-kernel call to sys_fadvise64_64() 2018-04-02 20:16:10 +02:00
sys_oabi-compat.c y2038: use time32 syscall names on 32-bit 2019-02-07 00:13:28 +01:00
tcm.c ARM: 8388/1: tcm: Don't crash when TCM banks are protected by TrustZone 2015-06-06 10:37:28 +01:00
thumbee.c ARM: convert printk(KERN_* to pr_* 2014-11-21 15:24:50 +00:00
time.c ARM/time: Remove read_boot_clock64() 2018-07-20 00:02:41 +02:00
topology.c ARM: topology: remove unneeded check for /cpus node 2018-09-28 14:25:58 -05:00
traps.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
unwind.c ARM: 8176/1: Use current_stack_pointer in unwind_backtrace 2014-11-13 23:58:09 +00:00
v7m.c ARM: 7828/1: ARMv7-M: implement restart routine common to all v7-M machines 2013-09-02 13:49:29 +01:00
vdso.c ARM: 8748/1: mm: Define vdso_start, vdso_end as array 2018-03-24 14:27:49 +00:00
vmlinux-xip.lds.S vmlinux.lds.h: Move LSM_TABLE into INIT_DATA 2018-10-10 20:40:21 -07:00
vmlinux.lds.S ARM: 8757/1: NOMMU: Support PMSAv8 MPU 2018-05-19 11:53:46 +01:00
vmlinux.lds.h vmlinux.lds.h: Fix incomplete .text.exit discards 2018-10-12 08:54:58 +11:00
xscale-cp0.c ARM: make xscale iwmmxt code multiplatform aware 2015-12-01 21:44:24 +01:00