Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4551431ybl; Tue, 21 Jan 2020 23:43:25 -0800 (PST) X-Google-Smtp-Source: APXvYqx+rxgjk9hQErNCjZsddO3u8tjJLllubYCz65/1JYjAFHujncsLAJX9uAwsw+2L20q5fBej X-Received: by 2002:a9d:65cf:: with SMTP id z15mr6699074oth.238.1579679005801; Tue, 21 Jan 2020 23:43:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579679005; cv=none; d=google.com; s=arc-20160816; b=ezS6KjkqPeS68SrIAG+6hDDe0RW+6wDNx1N0rpOO5NeAg9ZV5gl7h3mmYwuhUZjVxe GX7i8TyE+Pj83bfGoO4NhbecrC6BcRL3QkZy+znhs1tFYjBR75j8BOnjUD3wRmP+oj88 18IGbbU5jGxgiDpIIQHSNqWhnyX33HwLVx0iJ+7dEXGyqKSclWOFUxsJZiZR/jPSCllq 1OjZCqhu+9pKh65hkXUZifbEL6xZ/ii2oImymUQ6jGUxNwzvkAqCsKjZ2xU4kR6E1SX7 6t+4VDlkpLxZxKXHbkL4vO6vgGwFQ7I4aX3zjUKonTDzN53MhP2YXu3etwreaq5eDUtP w08w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=gwenWEedNOwW/5REZxff7h5FIMtZnG6yVmQb18MlMXk=; b=N691p67xDqP20rlp3A0dxvail4BZ5MrAkV8CDpr8fHx8RkHGbVi6HvS1nOMAay1IwF gA8Bcvb/bnV6drRiZiE5CBTS74zrYEswotiTWvcTwlXDp+o6yeACLQ3SmfaBOiUUDN/u Hl5ToT7hPsGcnwnxAYtYMDBtQsu1SbpNurr4sxUU01E2rGg1z3QJL8VSqxwVjypjcyNC 1fgFBq05/8609EdEA9ttTCuL4M8PoMc90YBjdJOSHKH8QsyvPze/uhQ/cg7/YDAijRlR t0MClG/k0B6RvcZz//1pPde9y15AOPtBG3ghx+18upfyyJwoRgBG0VM2XGjQ3orx6hcW aj4w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4si20311880oij.133.2020.01.21.23.43.13; Tue, 21 Jan 2020 23:43:25 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728609AbgAVHmV (ORCPT + 99 others); Wed, 22 Jan 2020 02:42:21 -0500 Received: from [167.172.186.51] ([167.172.186.51]:37734 "EHLO shell.v3.sk" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725883AbgAVHmU (ORCPT ); Wed, 22 Jan 2020 02:42:20 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id F263EDF340; Wed, 22 Jan 2020 07:42:27 +0000 (UTC) Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id JD6AL0fXdQgw; Wed, 22 Jan 2020 07:42:27 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 593E1DFD93; Wed, 22 Jan 2020 07:42:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at zimbra.v3.sk Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id jJ2e1UJDIMu1; Wed, 22 Jan 2020 07:42:27 +0000 (UTC) Received: from localhost (unknown [109.183.109.54]) by zimbra.v3.sk (Postfix) with ESMTPSA id E5E38DF340; Wed, 22 Jan 2020 07:42:26 +0000 (UTC) Date: Wed, 22 Jan 2020 08:42:15 +0100 From: Lubomir Rintel To: Aditya Pakki Cc: kjlu@umn.edu, Darren Hart , Andy Shevchenko , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, Juergen Gross , Andrew Morton , Heiko Carstens , Geert Uytterhoeven , Mike Rapoport , Sebastian Reichel , Allison Randal , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/platform/olpc: Fix the error handling of memblock_alloc failure Message-ID: <20200122074215.GA178804@furthur.local> References: <20200121232818.28018-1-pakki001@umn.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200121232818.28018-1-pakki001@umn.edu> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 21, 2020 at 05:28:16PM -0600, Aditya Pakki wrote: > In case of an error in memblock_alloc, the code calls both panic and > BUG_ON. Revert the error handling to BUG_ON. > > Fixes: 8a7f97b902f4 (add checks for the return value of memblock_alloc*()) > Signed-off-by: Aditya Pakki Reviewed-by: Lubomir Rintel Thank you Lubo > --- > arch/x86/platform/olpc/olpc_dt.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/arch/x86/platform/olpc/olpc_dt.c b/arch/x86/platform/olpc/olpc_dt.c > index 26d1f6693789..92d5ce1232ab 100644 > --- a/arch/x86/platform/olpc/olpc_dt.c > +++ b/arch/x86/platform/olpc/olpc_dt.c > @@ -137,9 +137,6 @@ void * __init prom_early_alloc(unsigned long size) > * wasted bootmem) and hand off chunks of it to callers. > */ > res = memblock_alloc(chunk_size, SMP_CACHE_BYTES); > - if (!res) > - panic("%s: Failed to allocate %zu bytes\n", __func__, > - chunk_size); > BUG_ON(!res); > prom_early_allocated += chunk_size; > memset(res, 0, chunk_size); > -- > 2.20.1 >