Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6465088imu; Mon, 21 Jan 2019 09:19:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN4mphzOXFUOQrq7hFYI7DD/1HwTP8270Q+FLXAbN1EGJzYSDoXJikSPBZp+2QW9FWN68VPL X-Received: by 2002:a63:5518:: with SMTP id j24mr28326311pgb.208.1548091189235; Mon, 21 Jan 2019 09:19:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548091189; cv=none; d=google.com; s=arc-20160816; b=vZ/OPsKsbgVzo2OfOLEGprT+82kdjNn2bd3IkPNveWLVpOijDHhzM0nn+XjHxGAu3N zF9nN99O5h7PGT8W8m7g9AVLeB3nJjYfD5MRjfPCrV10642W+823e4i1DyA0zo9pUYQ+ WzR7vUJNEx+Ssxid1BeMDxZTCIYPeMJv8mW7wmTRQZWof97eEbyiXyPUnzAh6FkPP6mY fQEoFcaHl1DYU3g2TJhVxLU+JztwdTBYHmIGoNpYaDAxOfY4k0TYjH0GytnhHnClCuIP jSD63sI+lAFJNTADer/0yuFe5oHTRN1Ou7pH9reOP3o4Tvbz/PZMiTZxhgHubExpBDtV U8sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=EFqa7iDie4a4Ugk0nz5p3iJ9mNe61MmNiPA7yNETE+A=; b=bv36BOAVc4Cstew1cWp5r0fejWYIUYU1lq4jwuPt7UryNfbwTXaYusTO6p7xfFQPaU 8yXYAal7NsArqlii9i9TVL5f1badeDr862XCBuXjhqGpMJnnq3Qd1ghaGF04ovzJSymG RpC+qSh64cfcpKuOyzGtE51YgSrhta68sk9iOLp8r0nox5WJIoK0pYHZ96dcBM+78Ro7 b6x7yteg7Hupdw9Cu1h4xxQlMi+j8LqszOcDgV2KvIxTQOggIFr+UHnqYLmu1Nw6709r WUgwMRGszs4wzU2/wXxTIbi7wh2z38DDNDrKwuhIErj7FBH7WMalaiYCSB6i74Nvl/JV efhQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5si12509330plz.419.2019.01.21.09.19.33; Mon, 21 Jan 2019 09:19:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727179AbfAURSZ (ORCPT + 99 others); Mon, 21 Jan 2019 12:18:25 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:45753 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726058AbfAURSY (ORCPT ); Mon, 21 Jan 2019 12:18:24 -0500 Received: by mail-ot1-f65.google.com with SMTP id 32so21125401ota.12; Mon, 21 Jan 2019 09:18:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=EFqa7iDie4a4Ugk0nz5p3iJ9mNe61MmNiPA7yNETE+A=; b=oaZLGvK7EHRbWBAdMTOd/g2k5OK/zzsVYNjEIc7HZqKwydMSLQgs7yUQFb2Drqq++p R4VG0JRK+mRxTy+hbqs/H+sofqwHt9QPFWVCT9gty/8N3dCYIpyqsmLmnfAVhT2z9Zno 2r1vq47Nkpbb6GDVKA+HHOTP2j55ojNKWoH8jV9CcjzHvxOFIjZLU5S+0FGorXzv2vd7 pDfV+jJpdNQxaN4ywuu9RS/CizQzQmx+Z3wNi40sW8CkXbLUnvIduC9JBhYvQywaKzjU MWyz9sVxk9dy6Sc1r9F+lAj9xK0kx0qVnzer2nMUlRM3FspoNGVqlIKMZayFpB68cqwm ys8w== X-Gm-Message-State: AJcUukdrW0eKxi+b2fyAdYHRQYCL0nJFXt67qKbB1ZMNKBNO3ECp9DJR jFRxUrfmDSkynED0le+sWw== X-Received: by 2002:a9d:4b15:: with SMTP id q21mr20338887otf.30.1548091102479; Mon, 21 Jan 2019 09:18:22 -0800 (PST) Received: from localhost (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id r1sm6393991oie.44.2019.01.21.09.18.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Jan 2019 09:18:21 -0800 (PST) Date: Mon, 21 Jan 2019 11:18:21 -0600 From: Rob Herring To: Mike Rapoport Cc: linux-mm@kvack.org, Andrew Morton , Catalin Marinas , Christoph Hellwig , "David S. Miller" , Dennis Zhou , Geert Uytterhoeven , Greentime Hu , Greg Kroah-Hartman , Guan Xuetao , Guo Ren , Heiko Carstens , Mark Salter , Matt Turner , Max Filippov , Michael Ellerman , Michal Simek , Paul Burton , Petr Mladek , Rich Felker , Richard Weinberger , Russell King , Stafford Horne , Tony Luck , Vineet Gupta , Yoshinori Sato , devicetree@vger.kernel.org, kasan-dev@googlegroups.com, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org, linux-usb@vger.kernel.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, openrisc@lists.librecores.org, sparclinux@vger.kernel.org, uclinux-h8-devel@lists.sourceforge.jp, x86@kernel.org, xen-devel@lists.xenproject.org Subject: Re: [PATCH v2 19/21] treewide: add checks for the return value of memblock_alloc*() Message-ID: <20190121171821.GA13557@bogus> References: <1548057848-15136-1-git-send-email-rppt@linux.ibm.com> <1548057848-15136-20-git-send-email-rppt@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1548057848-15136-20-git-send-email-rppt@linux.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 21, 2019 at 10:04:06AM +0200, Mike Rapoport wrote: > 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); > > Signed-off-by: Mike Rapoport > Reviewed-by: Guo Ren # c-sky > Acked-by: Paul Burton # MIPS > Acked-by: Heiko Carstens # s390 > Reviewed-by: Juergen Gross # Xen > --- > arch/alpha/kernel/core_cia.c | 3 +++ > arch/alpha/kernel/core_marvel.c | 6 ++++++ > arch/alpha/kernel/pci-noop.c | 13 +++++++++++-- > arch/alpha/kernel/pci.c | 11 ++++++++++- > arch/alpha/kernel/pci_iommu.c | 12 ++++++++++++ > arch/arc/mm/highmem.c | 4 ++++ > arch/arm/kernel/setup.c | 6 ++++++ > arch/arm/mm/mmu.c | 14 +++++++++++++- > arch/arm64/kernel/setup.c | 8 +++++--- > arch/arm64/mm/kasan_init.c | 10 ++++++++++ > arch/c6x/mm/dma-coherent.c | 4 ++++ > arch/c6x/mm/init.c | 3 +++ > arch/csky/mm/highmem.c | 5 +++++ > arch/h8300/mm/init.c | 3 +++ > arch/m68k/atari/stram.c | 4 ++++ > arch/m68k/mm/init.c | 3 +++ > arch/m68k/mm/mcfmmu.c | 6 ++++++ > arch/m68k/mm/motorola.c | 9 +++++++++ > arch/m68k/mm/sun3mmu.c | 6 ++++++ > arch/m68k/sun3/sun3dvma.c | 3 +++ > arch/microblaze/mm/init.c | 8 ++++++-- > arch/mips/cavium-octeon/dma-octeon.c | 3 +++ > arch/mips/kernel/setup.c | 3 +++ > arch/mips/kernel/traps.c | 3 +++ > arch/mips/mm/init.c | 5 +++++ > arch/nds32/mm/init.c | 12 ++++++++++++ > arch/openrisc/mm/ioremap.c | 8 ++++++-- > arch/powerpc/kernel/dt_cpu_ftrs.c | 5 +++++ > arch/powerpc/kernel/pci_32.c | 3 +++ > arch/powerpc/kernel/setup-common.c | 3 +++ > arch/powerpc/kernel/setup_64.c | 4 ++++ > arch/powerpc/lib/alloc.c | 3 +++ > arch/powerpc/mm/hash_utils_64.c | 3 +++ > arch/powerpc/mm/mmu_context_nohash.c | 9 +++++++++ > arch/powerpc/mm/pgtable-book3e.c | 12 ++++++++++-- > arch/powerpc/mm/pgtable-book3s64.c | 3 +++ > arch/powerpc/mm/pgtable-radix.c | 9 ++++++++- > arch/powerpc/mm/ppc_mmu_32.c | 3 +++ > arch/powerpc/platforms/pasemi/iommu.c | 3 +++ > arch/powerpc/platforms/powermac/nvram.c | 3 +++ > arch/powerpc/platforms/powernv/opal.c | 3 +++ > arch/powerpc/platforms/powernv/pci-ioda.c | 8 ++++++++ > arch/powerpc/platforms/ps3/setup.c | 3 +++ > arch/powerpc/sysdev/msi_bitmap.c | 3 +++ > arch/s390/kernel/setup.c | 13 +++++++++++++ > arch/s390/kernel/smp.c | 5 ++++- > arch/s390/kernel/topology.c | 6 ++++++ > arch/s390/numa/mode_emu.c | 3 +++ > arch/s390/numa/numa.c | 6 +++++- > arch/sh/mm/init.c | 6 ++++++ > arch/sh/mm/numa.c | 4 ++++ > arch/um/drivers/net_kern.c | 3 +++ > arch/um/drivers/vector_kern.c | 3 +++ > arch/um/kernel/initrd.c | 2 ++ > arch/um/kernel/mem.c | 16 ++++++++++++++++ > arch/unicore32/kernel/setup.c | 4 ++++ > arch/unicore32/mm/mmu.c | 15 +++++++++++++-- > arch/x86/kernel/acpi/boot.c | 3 +++ > arch/x86/kernel/apic/io_apic.c | 5 +++++ > arch/x86/kernel/e820.c | 3 +++ > arch/x86/platform/olpc/olpc_dt.c | 3 +++ > arch/x86/xen/p2m.c | 11 +++++++++-- > arch/xtensa/mm/kasan_init.c | 4 ++++ > arch/xtensa/mm/mmu.c | 3 +++ > drivers/clk/ti/clk.c | 3 +++ > drivers/macintosh/smu.c | 3 +++ > drivers/of/fdt.c | 8 +++++++- > drivers/of/unittest.c | 8 +++++++- Acked-by: Rob Herring > drivers/xen/swiotlb-xen.c | 7 +++++-- > kernel/power/snapshot.c | 3 +++ > lib/cpumask.c | 3 +++ > mm/kasan/init.c | 10 ++++++++-- > mm/sparse.c | 19 +++++++++++++++++-- > 73 files changed, 409 insertions(+), 28 deletions(-)