From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80B32C43387 for ; Wed, 16 Jan 2019 15:18:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 51A9F20675 for ; Wed, 16 Jan 2019 15:18:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="B/RzBcaG"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="JkSu1+jT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 51A9F20675 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1jQhxvxYFx90bJdHMrkQHUd312X/Ii4A2jENCt6k+Do=; b=B/RzBcaGqKXjPT Nb2CpuslSuBTVwSm5x3X6N7t6fFX060eTF87MwD+QlmRcylribZFxyQ+9RsvDVtNZBXX7FSST4hrF qbmU66SKPECODOuA0sG0N62pXo/lPYDX5U7izh+luWzv47pC2H2nBfoy9Kjj2+LyGx2btoYruVC2x dzj4PgGOKp8pKWkqXHw4cPA4Txz2TgPGfBwXmOH5BigW+9Jr2Y3NQQ9Fz6l/WodlpSHc56FwWHiFB PHzYTt3D5f6JDAKsZuc6zEXLZb8hKP6lW3fJC7hleBpfPJm8IIUYskAKVmoXpBAhcVRIRA3gHUfUa Z6oaqY98ZofX0SdU0lBg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gjmxn-00049d-Qb; Wed, 16 Jan 2019 15:18:43 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gjmxi-000493-IZ; Wed, 16 Jan 2019 15:18:41 +0000 Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 170452146F; Wed, 16 Jan 2019 15:18:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547651918; bh=b4Eql+8wNKqBmh8BvWalk13WRrshCh12iUx8UsuWK8E=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=JkSu1+jTgn8E6t9MsNAnVaKD542EI651VmqHCGoshYwXnBBh1Lk4VrjRnusOGHfjF dMHZN9BAfRUrprOjsJBF2DV/Js0SKnxUu+30qQlTIqIHMVHJzTzLFPIX8h2Oo6urIG XuM4lN+kX4uKamkzA57JhDOzTJ3RCArAzIERcaOQ= Received: by mail-qt1-f175.google.com with SMTP id t33so7508838qtt.4; Wed, 16 Jan 2019 07:18:38 -0800 (PST) X-Gm-Message-State: AJcUukc97vIjp5R/Ry0YKrhtL6VvcTb0nPx8oye2CWaQFHbRXmR73Up+ KxLfsC7aN+IQCRZ7RK9UnxZaT7bYThaG6tHepQ== X-Google-Smtp-Source: ALg8bN6Aerzng9MYdYFtGlC2Vm/MJ3dRnLBf8aQMtjzVS1FyEWvF4taDPm9ofb5/nWrfOp6wvev0h6PuNyNEHftwz5w= X-Received: by 2002:aed:3ecf:: with SMTP id o15mr7523514qtf.26.1547651916185; Wed, 16 Jan 2019 07:18:36 -0800 (PST) MIME-Version: 1.0 References: <1547646261-32535-1-git-send-email-rppt@linux.ibm.com> <1547646261-32535-20-git-send-email-rppt@linux.ibm.com> In-Reply-To: <1547646261-32535-20-git-send-email-rppt@linux.ibm.com> From: Rob Herring Date: Wed, 16 Jan 2019 09:18:24 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 19/21] treewide: add checks for the return value of memblock_alloc*() To: Mike Rapoport X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190116_071840_162959_4D39D4F8 X-CRM114-Status: GOOD ( 16.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rich Felker , linux-ia64@vger.kernel.org, devicetree@vger.kernel.org, Catalin Marinas , Heiko Carstens , x86@kernel.org, linux-mips@vger.kernel.org, Max Filippov , Guo Ren , sparclinux@vger.kernel.org, Christoph Hellwig , linux-s390@vger.kernel.org, linux-c6x-dev@linux-c6x.org, Yoshinori Sato , Richard Weinberger , SH-Linux , Russell King , kasan-dev@googlegroups.com, Geert Uytterhoeven , Mark Salter , Dennis Zhou , Matt Turner , arcml , "moderated list:H8/300 ARCHITECTURE" , Petr Mladek , linux-xtensa@linux-xtensa.org, linux-alpha@vger.kernel.org, linux-um@lists.infradead.org, linux-m68k@lists.linux-m68k.org, Openrisc , Greentime Hu , xen-devel@lists.xenproject.org, Stafford Horne , Guan Xuetao , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , Michal Simek , Tony Luck , linux-mm@kvack.org, Greg Kroah-Hartman , Linux USB List , "linux-kernel@vger.kernel.org" , Paul Burton , Vineet Gupta , Michael Ellerman , Andrew Morton , linuxppc-dev , "David S. Miller" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jan 16, 2019 at 7:46 AM 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 > --- > arch/alpha/kernel/core_cia.c | 3 +++ > arch/alpha/kernel/core_marvel.c | 6 ++++++ > arch/alpha/kernel/pci-noop.c | 11 ++++++++++- > 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 | 9 ++++++--- > 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/s390/numa/toptree.c | 8 ++++++-- > 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 +++++++++++++++++-- > 74 files changed, 415 insertions(+), 29 deletions(-) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel