1
0
Fork 0
alistair23-linux/arch/arm
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
..
boot Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-03-11 08:54:01 -07:00
common Included in this update: 2019-01-05 11:23:17 -08:00
configs configs: get rid of obsolete CONFIG_ENABLE_WARN_DEPRECATED 2019-03-07 18:32:02 -08:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2019-03-05 09:09:55 -08:00
firmware
include DMA mapping updates for 5.1 2019-03-10 11:54:48 -07:00
kernel treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
kvm arm/arm64: KVM: Don't panic on failure to properly reset system registers 2019-02-07 11:44:46 +00:00
lib ARM: 8813/1: Make aligned 2-byte getuser()/putuser() atomic on ARMv6+ 2018-11-12 10:52:04 +00:00
mach-actions
mach-alpine PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
mach-artpec
mach-asm9260
mach-aspeed
mach-at91 treewide: add intermediate .s files to targets 2018-12-23 10:12:08 +09:00
mach-axxia
mach-bcm bcm2835-pm: Move bcm2835-watchdog's DT probe to an MFD. 2019-01-09 16:55:06 +01:00
mach-berlin
mach-clps711x
mach-cns3xxx ARM: cns3xxx: Use actual size reads for PCIe 2019-01-31 15:07:16 -06:00
mach-davinci Power management updates for 5.1-rc1 2019-03-06 12:59:46 -08:00
mach-digicolor
mach-dove
mach-ebsa110
mach-efm32
mach-ep93xx arch/arm/mach-ep93xx: Remove duplicate header 2019-01-30 22:59:53 +01:00
mach-exynos ARM: exynos: Fix timeout when booting secondary CPUs 2019-02-01 20:07:47 +01:00
mach-footbridge PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
mach-gemini
mach-highbank
mach-hisi
mach-imx DMA mapping updates for 5.1 2019-03-10 11:54:48 -07:00
mach-integrator ARM: integrator: impd1: use struct_size() in devm_kzalloc() 2019-01-11 13:33:00 +01:00
mach-iop13xx
mach-iop32x ARM: iop32x/n2100: fix PCI IRQ mapping 2019-01-30 11:34:42 +01:00
mach-iop33x
mach-ixp4xx PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
mach-keystone
mach-ks8695 ARM: SoC platform updates 2018-12-31 17:27:54 -08:00
mach-lpc18xx
mach-lpc32xx ARM: lpc32xx: remove platform data of ARM PL111 LCD controller 2019-02-03 21:40:41 +02:00
mach-mediatek arm: mediatek: add MT7629 smp bring up code 2019-02-07 17:59:16 +01:00
mach-meson ARM: meson: remove COMMON_CLK_AMLOGIC selection 2019-02-06 19:53:02 -08:00
mach-milbeaut ARM: milbeaut: Add basic support for Milbeaut m10v SoC 2019-03-01 15:18:26 +01:00
mach-mmp regulator: fixed/gpio: Pull inversion/OD into gpiolib 2019-02-06 15:58:29 +00:00
mach-moxart
mach-mv78xx0 PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
mach-mvebu PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
mach-mxs
mach-netx
mach-nomadik
mach-npcm
mach-nspire
mach-omap1 Merge branch 'i2c/for-5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2019-03-08 09:27:33 -08:00
mach-omap2 ARM: SoC device tree updates for 5.1 2019-03-06 09:36:37 -08:00
mach-orion5x ARM: orion5x: Include platform_data/dsa.h 2019-01-17 11:31:24 -08:00
mach-oxnas
mach-picoxcell
mach-prima2
mach-pxa ARM: SoC platform updates for 5.1 2019-03-06 09:33:05 -08:00
mach-qcom
mach-rda ARM: Prepare RDA8810PL SoC 2018-12-31 13:09:39 -08:00
mach-realview ARM: vexpress/realview: consolidate immitation CPU hotplug 2018-12-14 14:44:59 +00:00
mach-rockchip
mach-rpc
mach-s3c24xx ARM: s3c24xx: Fix boolean expressions in osiris_dvs_notify 2019-01-07 20:41:01 +01:00
mach-s3c64xx regulator: wm8994: Pass descriptor instead of GPIO number 2018-11-15 11:42:08 -08:00
mach-s5pv210 ARM: s5pv210: Remove legacy setting of external wakeup interrupts 2018-11-12 21:19:48 +01:00
mach-sa1100 This is the bulk of GPIO changes for the v5.1 cycle: 2019-03-08 10:09:53 -08:00
mach-shmobile ARM: shmobile: Fix R-Car Gen2 regulator quirk 2019-01-07 13:24:07 +01:00
mach-socfpga reset: socfpga: declare socfpga_reset_init in a header file 2019-01-28 11:16:04 +01:00
mach-spear
mach-sti ARM: sti: remove pen_release and boot_lock 2018-12-20 14:32:15 +01:00
mach-stm32
mach-sunxi reset: sunxi: declare sun6i_reset_init in a header file 2019-01-28 11:16:04 +01:00
mach-tango ARM: tango: Improve ARCH_MULTIPLATFORM compatibility 2019-01-30 11:45:10 +01:00
mach-tegra ARM: tegra: Restore memory arbitration on resume from LP1 on Tegra30+ 2019-01-16 13:22:04 +01:00
mach-u300
mach-uniphier
mach-ux500
mach-versatile mmc: mmci: Drop support for pdata GPIO numbers 2018-10-08 11:40:43 +02:00
mach-vexpress ARM: vexpress/realview: consolidate immitation CPU hotplug 2018-12-14 14:44:59 +00:00
mach-vt8500
mach-w90x900
mach-zx
mach-zynq
mm treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
net arm: bpf: implement jitting of JMP32 2019-01-26 13:33:02 -08:00
nwfpe
oprofile Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
plat-iop
plat-omap ARM: Kconfig: remove useless "default n" 2018-11-08 10:53:09 +00:00
plat-orion ARM: orion5x: Include platform_data/dsa.h 2019-01-17 11:31:24 -08:00
plat-pxa ARM: pxa: ssp: unneeded to free devm_ allocated data 2019-01-23 21:32:01 +01:00
plat-samsung ARM: samsung: Limit SAMSUNG_PM_DEBUG config option to non-Exynos platforms 2018-11-18 15:11:27 +01:00
plat-versatile ARM: versatile: rename and comment SMP implementation 2018-12-14 14:44:59 +00:00
probes ARM: 8834/1: Fix: kprobes: optimized kprobes illegal instruction 2019-02-12 15:20:58 +00:00
tools y2038: add 64-bit time_t syscalls to all 32-bit architectures 2019-02-07 00:13:28 +01:00
vdso
vfp Merge branches 'misc', 'sa1100-for-next' and 'spectre' into for-linus 2019-01-02 10:37:05 +00:00
xen get rid of legacy 'get_ds()' function 2019-03-04 10:50:14 -08:00
Kconfig DMA mapping updates for 5.1 2019-03-10 11:54:48 -07:00
Kconfig-nommu
Kconfig.debug i.MX SoC changes for 4.21: 2018-12-12 13:52:48 -08:00
Makefile ARM: milbeaut: Add basic support for Milbeaut m10v SoC 2019-03-01 15:18:26 +01:00