public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/platform/olpc: Fix the error handling of memblock_alloc failure
@ 2020-01-21 23:28 Aditya Pakki
  2020-01-22  7:42 ` Lubomir Rintel
  0 siblings, 1 reply; 2+ messages in thread
From: Aditya Pakki @ 2020-01-21 23:28 UTC (permalink / raw)
  To: pakki001
  Cc: kjlu, Darren Hart, Andy Shevchenko, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, H. Peter Anvin, x86, Juergen Gross,
	Andrew Morton, Heiko Carstens, Geert Uytterhoeven, Mike Rapoport,
	Lubomir Rintel, Sebastian Reichel, Allison Randal,
	platform-driver-x86, linux-kernel

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 <pakki001@umn.edu>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86/platform/olpc: Fix the error handling of memblock_alloc failure
  2020-01-21 23:28 [PATCH] x86/platform/olpc: Fix the error handling of memblock_alloc failure Aditya Pakki
@ 2020-01-22  7:42 ` Lubomir Rintel
  0 siblings, 0 replies; 2+ messages in thread
From: Lubomir Rintel @ 2020-01-22  7:42 UTC (permalink / raw)
  To: Aditya Pakki
  Cc: kjlu, Darren Hart, Andy Shevchenko, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, H. Peter Anvin, x86, Juergen Gross,
	Andrew Morton, Heiko Carstens, Geert Uytterhoeven, Mike Rapoport,
	Sebastian Reichel, Allison Randal, platform-driver-x86,
	linux-kernel

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 <pakki001@umn.edu>

Reviewed-by: Lubomir Rintel <lkundrak@v3.sk>

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
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-22  7:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-21 23:28 [PATCH] x86/platform/olpc: Fix the error handling of memblock_alloc failure Aditya Pakki
2020-01-22  7:42 ` Lubomir Rintel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox