1
0
Fork 0
alistair23-linux/arch/powerpc/lib
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
..
Makefile powerpc: sstep: Add tests for compute type instructions 2019-02-23 21:04:31 +11:00
alloc.c treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
checksum_32.S powerpc: Implement csum_ipv6_magic in assembly 2018-06-04 00:39:19 +10:00
checksum_64.S powerpc: fix csum_ipv6_magic() on little endian platforms 2018-09-20 21:12:28 +10:00
checksum_wrappers.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
code-patching.c powerpc: simplify patch_instruction_site() and patch_branch_site() 2018-12-19 18:56:32 +11:00
copy_32.S powerpc/lib: Use patch_site to patch copy_32 functions once cache is enabled 2018-08-10 22:12:35 +10:00
copypage_64.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
copypage_power7.S powerpc/64: enhance memcmp() with VMX instruction for long bytes comparision 2018-07-24 22:03:21 +10:00
copyuser_64.S powerpc/64: Copy as much as possible in __copy_tofrom_user 2018-08-08 00:32:36 +10:00
copyuser_power7.S selftests/powerpc/64: Test all paths through copy routines 2018-08-08 00:32:35 +10:00
crtsavres.S powerpc/64: Do not create new section for save/restore functions 2017-05-30 14:59:51 +10:00
div64.S powerpc: Fix a corner case in __div64_32 2005-10-20 09:37:02 +10:00
error-inject.c powerpc: Add support for function error injection 2018-10-20 13:26:43 +11:00
feature-fixups-test.S powerpc: move ASM_CONST and stringify_in_c() into asm-const.h 2018-07-30 22:48:16 +10:00
feature-fixups.c powerpc/fsl: Add infrastructure to fixup branch predictor flush 2018-12-20 22:53:39 +11:00
hweight_64.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
ldstfp.S powerpc: move ASM_CONST and stringify_in_c() into asm-const.h 2018-07-30 22:48:16 +10:00
locks.c powerpc: clean the inclusion of stringify.h 2018-07-30 22:48:17 +10:00
mem_64.S powerpc/64: Remove static branch hints from memset() 2018-09-17 21:17:25 +10:00
memcmp_32.S powerpc/lib: optimise PPC32 memcmp 2018-06-04 00:39:21 +10:00
memcmp_64.S powerpc/64: add 32 bytes prechecking before using VMX optimization on memcmp() 2018-07-24 22:03:21 +10:00
memcpy_64.S selftests/powerpc/64: Test all paths through copy routines 2018-08-08 00:32:35 +10:00
memcpy_power7.S selftests/powerpc/64: Test all paths through copy routines 2018-08-08 00:32:35 +10:00
pmem.c powerpc/lib: Implement UACCESS_FLUSHCACHE API 2017-11-13 08:00:31 +11:00
quad.S powerpc: Handle most loads and stores in instruction emulation code 2017-09-01 16:39:48 +10:00
rheap.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
sstep.c powerpc sstep: Add support for modsd, modud instructions 2019-02-26 00:05:20 +11:00
string.S powerpc/lib: optimise PPC32 memcmp 2018-06-04 00:39:21 +10:00
string_32.S powerpc/lib: optimise 32 bits __clear_user() 2018-06-04 00:39:21 +10:00
string_64.S powerpc: Fix invalid use of register expressions 2017-08-10 22:29:41 +10:00
strlen_32.S powerpc/lib: Implement strlen() in assembly for PPC32 2018-08-07 21:49:30 +10:00
test_emulate_step.c powerpc: sstep: Add tests for addc[.] instruction 2019-02-23 21:04:31 +11:00
test_emulate_step_exec_instr.S powerpc: sstep: Add tests for compute type instructions 2019-02-23 21:04:31 +11:00
vmx-helper.c powerpc/64: enhance memcmp() with VMX instruction for long bytes comparision 2018-07-24 22:03:21 +10:00
xor_vmx.c powerpc/lib/xor_vmx: Ensure no altivec code executes before enable_kernel_altivec() 2017-06-02 20:17:52 +10:00
xor_vmx.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xor_vmx_glue.c powerpc/altivec: Add missing prototypes for altivec 2018-05-25 12:04:38 +10:00