1
0
Fork 0
alistair23-linux/drivers/xen
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
..
events xen: Fix x86 sched_clock() interface for xen 2019-01-16 13:06:05 -05:00
xen-pciback xen/pciback: Check dev_data before using it 2018-12-17 10:29:50 -05:00
xenbus xen: drop writing error messages to xenstore 2018-10-26 09:17:16 +02:00
xenfs License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig xen: Introduce shared buffer helpers for page directory... 2018-12-18 12:15:55 -05:00
Makefile xen: Introduce shared buffer helpers for page directory... 2018-12-18 12:15:55 -05:00
acpi.c xen: rename dom0_op to platform_op 2015-12-21 14:40:55 +00:00
arm-device.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
balloon.c xen/balloon: mark inflated pages PG_offline 2019-03-05 21:07:14 -08:00
biomerge.c block: remove ARCH_BIOVEC_PHYS_MERGEABLE 2018-09-26 08:45:11 -06:00
cpu_hotplug.c xen: avoid crash in disable_hotplug_cpu 2018-09-14 08:51:10 -04:00
dbgp.c
efi.c xen: Implement EFI reset_system callback 2017-05-02 12:06:50 +02:00
evtchn.c treewide: kvmalloc() -> kvmalloc_array() 2018-06-12 16:19:22 -07:00
fallback.c
features.c xen: audit usages of module.h ; remove unnecessary instances 2016-03-21 15:13:32 +00:00
gntalloc.c mm: treewide: remove GFP_TEMPORARY allocation flag 2017-09-13 18:53:16 -07:00
gntdev-common.h xen/gntdev: Add initial support for dma-buf UAPI 2018-07-26 23:05:14 -04:00
gntdev-dmabuf.c drm pull for 4.19-rc1 2018-08-15 17:39:07 -07:00
gntdev-dmabuf.h xen/gntdev: Add initial support for dma-buf UAPI 2018-07-26 23:05:14 -04:00
gntdev.c mm/mmu_notifier: use structure for invalidate_range_start/end callback 2018-12-28 12:11:50 -08:00
grant-table.c xen: fixes for 4.20-rc2 2018-11-10 08:58:48 -06:00
manage.c xen/manage: don't complain about an empty value in control/sysrq node 2018-09-14 08:51:10 -04:00
mcelog.c xen/mcelog: eliminate redundant setting of interface version 2018-08-20 14:46:18 -04:00
mem-reservation.c xen/balloon: add runtime control for scrubbing ballooned out pages 2018-09-14 08:51:10 -04:00
pci.c
pcpu.c xen: rename dom0_op to platform_op 2015-12-21 14:40:55 +00:00
platform-pci.c xen-platform: constify pci_device_id. 2017-08-31 09:45:55 -04:00
preempt.c
privcmd-buf.c xen: remove size limit of privcmd-buf mapping interface 2018-11-09 16:38:34 +01:00
privcmd.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
privcmd.h xen: add new hypercall buffer mapping device 2018-06-22 08:26:42 +02:00
pvcalls-back.c xen/pvcalls: remove set but not used variable 'intf' 2019-01-04 10:55:27 -05:00
pvcalls-front.c pvcalls-front: fix potential null dereference 2019-01-15 16:13:47 -05:00
pvcalls-front.h xen: fix poll misannotation 2018-02-01 10:07:32 -05:00
swiotlb-xen.c treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
sys-hypervisor.c xen: add sysfs node for hypervisor build id 2017-06-15 08:50:37 +02:00
time.c x86/paravirt: Use a single ops structure 2018-09-03 16:50:35 +02:00
tmem.c mm, swap, frontswap: fix THP swap if frontswap enabled 2018-02-21 15:35:43 -08:00
xen-acpi-cpuhotplug.c xen: rename dom0_op to platform_op 2015-12-21 14:40:55 +00:00
xen-acpi-memhotplug.c
xen-acpi-pad.c xen: don't include <xen/xen.h> from <asm/io.h> and <asm/dma-mapping.h> 2018-09-26 08:45:18 -06:00
xen-acpi-processor.c xen/ACPI: don't upload Px/Cx data for disabled processors 2018-08-20 14:46:18 -04:00
xen-balloon.c xen/balloon: Support xend-based toolstack 2018-10-24 10:18:47 +02:00
xen-front-pgdir-shbuf.c xen: Introduce shared buffer helpers for page directory... 2018-12-18 12:15:55 -05:00
xen-scsiback.c scsi: target/core: Remove the write_pending_status() callback function 2019-02-04 21:23:59 -05:00
xen-selfballoon.c mm: convert totalram_pages and totalhigh_pages variables to atomic 2018-12-28 12:11:47 -08:00
xen-stub.c
xlate_mmu.c xen: xlate_mmu: add missing header to fix 'W=1' warning 2018-11-29 17:53:27 +01:00