1
0
Fork 0
alistair23-linux/arch/mips
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
..
alchemy A few early MIPS fixes for 4.21: 2019-01-05 12:48:25 -08:00
ar7 net: phy: fixed-phy: Drop GPIO from fixed_phy_add() 2019-02-04 18:33:36 -08:00
ath25 PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
ath79 MIPS: ath79: drop !OF clock code 2019-01-22 11:17:22 -08:00
bcm47xx Here's the main MIPS pull request for v5.1: 2019-03-05 11:28:25 -08:00
bcm63xx MIPS: BCM63XX: provide DMA masks for ethernet devices 2019-02-25 12:56:39 -08:00
bmips mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
boot Kbuild updates for v5.1 2019-03-10 17:48:21 -07:00
cavium-octeon treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
cobalt
configs fscrypt updates for v5.1 2019-03-09 10:54:24 -08:00
crypto MIPS: crypto: Add crc32 and crc32c hw accelerated module 2018-02-19 20:50:36 +00:00
dec mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
emma mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
fw mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
generic MIPS: mscc: add PCB120 to the ocelot fitImage 2018-10-09 10:38:29 -07:00
include DMA mapping updates for 5.1 2019-03-10 11:54:48 -07:00
jazz MIPS: jazz: fix 64bit build 2019-01-09 13:14:34 -08:00
jz4740 MIPS: ingenic: Add support for appended devicetree 2019-02-21 15:55:41 -08:00
kernel treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
kvm MIPS: MemoryMapID (MMID) Support 2019-02-04 10:56:41 -08:00
lantiq Here's the main MIPS pull request for v5.1: 2019-03-05 11:28:25 -08:00
lasat mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
lib MIPS: MemoryMapID (MMID) Support 2019-02-04 10:56:41 -08:00
loongson32 MIPS: Loongson32: Remove DMA & NAND devices from ls1b/board.c 2019-02-04 14:44:33 -08:00
loongson64 mips: loongson64: remove unreachable(), fix loongson_poweroff(). 2019-02-07 11:50:14 -08:00
math-emu mips: math-emu: no need to check return value of debugfs_create functions 2019-01-22 11:17:20 -08:00
mm treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
mti-malta MIPS: malta: Use img-ascii-lcd driver for LCD display 2018-11-20 21:05:39 -08:00
net MIPS: eBPF: Fix icache flush end address 2019-03-02 00:04:15 +01:00
netlogic mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
oprofile Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
paravirt mips: unify prom_putchar() declarations 2018-07-17 09:40:17 -07:00
pci Here's the main MIPS pull request for v5.1: 2019-03-05 11:28:25 -08:00
pic32 mips: unify prom_putchar() declarations 2018-07-17 09:40:17 -07:00
pistachio License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pmcs-msp71xx PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
pnx833x mtd: rawnand: Move platform_nand_xxx definitions out of rawnand.h 2018-10-03 11:12:25 +02:00
power License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ralink mips: ralink: no need to check return value of debugfs_create functions 2019-01-22 11:17:20 -08:00
rb532 ata: rb532_cf: Convert to use GPIO descriptors 2018-12-04 17:15:25 -07:00
sgi-ip22 MIPS: Remove no-op/identity casts 2018-08-31 11:49:20 -07:00
sgi-ip27 MIPS: SGI-IP27: rework HUB interrupts 2019-02-19 12:46:03 -08:00
sgi-ip32 MIPS: IP32: use generic dma noncoherent ops 2018-06-24 09:27:27 -07:00
sibyte Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
sni MIPS: sni: Remove the read_persistent_clock() 2018-05-14 23:58:25 +01:00
tools MIPS: Use a custom elf-entry program to find kernel entry point 2018-08-30 09:39:22 -07:00
txx9 PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
vdso MIPS: VDSO: Include $(ccflags-vdso) in o32,n32 .lds builds 2019-01-29 11:50:58 -08:00
vr41xx PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
Kbuild MIPS: Disable Werror when W= is set 2017-04-10 11:56:07 +02:00
Kbuild.platforms MIPS: Xilfpga: Switch to using generic defconfigs 2017-11-08 22:54:14 +00:00
Kconfig DMA mapping updates for 5.1 2019-03-10 11:54:48 -07:00
Kconfig.debug Kconfig: consolidate the "Kernel hacking" menu 2018-08-02 08:06:48 +09:00
Makefile MIPS: Add GINVT instruction helpers 2019-02-04 10:56:35 -08:00
Makefile.postlink License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00