From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guo Ren Subject: Re: [PATCH 19/21] treewide: add checks for the return value of memblock_alloc*() Date: Thu, 17 Jan 2019 15:06:03 +0800 Message-ID: <20190117070602.GA31839@guoren-Inspiron-7460> References: <1547646261-32535-1-git-send-email-rppt@linux.ibm.com> <1547646261-32535-20-git-send-email-rppt@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1547646261-32535-20-git-send-email-rppt@linux.ibm.com> Sender: linux-kernel-owner@vger.kernel.org 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 , Heiko Carstens , Mark Salter , Matt Turner , Max Filippov , Michael Ellerman , Michal Simek , Paul Burton , Petr Mladek , Rich Felker , Richard Weinberger , Rob Herring List-Id: devicetree@vger.kernel.org On Wed, Jan 16, 2019 at 03:44:19PM +0200, Mike Rapoport wrote: > arch/csky/mm/highmem.c | 5 +++++ ... > diff --git a/arch/csky/mm/highmem.c b/arch/csky/mm/highmem.c > index 53b1bfa..3317b774 100644 > --- a/arch/csky/mm/highmem.c > +++ b/arch/csky/mm/highmem.c > @@ -141,6 +141,11 @@ static void __init fixrange_init(unsigned long start, unsigned long end, > for (; (k < PTRS_PER_PMD) && (vaddr != end); pmd++, k++) { > if (pmd_none(*pmd)) { > pte = (pte_t *) memblock_alloc_low(PAGE_SIZE, PAGE_SIZE); > + if (!pte) > + panic("%s: Failed to allocate %lu bytes align=%lx\n", > + __func__, PAGE_SIZE, > + PAGE_SIZE); > + > set_pmd(pmd, __pmd(__pa(pte))); > BUG_ON(pte != pte_offset_kernel(pmd, 0)); > } Looks good for me and panic is ok. Reviewed-by: Guo Ren