From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932158AbcG0Rlt (ORCPT ); Wed, 27 Jul 2016 13:41:49 -0400 Received: from relay2.sgi.com ([192.48.180.65]:32854 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757194AbcG0RlD (ORCPT ); Wed, 27 Jul 2016 13:41:03 -0400 Message-Id: <20160727173331.676120136@asylum.americas.sgi.com> References: <20160727173331.230927085@asylum.americas.sgi.com> User-Agent: quilt/0.46-1 Date: Wed, 27 Jul 2016 12:33:33 -0500 From: Mike Travis To: Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , Andrew Morton , Dimitri Sivanich Cc: Russ Anderson , John Estabrook , Andrew Banman , Nathan Zimmer , x86@kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH 2/4] x86/platform/UV: Fix problem with bad UV4 EFI System Table causing panic Content-Disposition: inline; filename=uv4_fix_bios_init_error Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix a problem that occurs if for some reason the UV4 EFI System Table is not available, the check inadvertantly can cause a panic. Reviewed-by: Dimitri Sivanich Reviewed-by: Nathan Zimmer Tested-by: Frank Ramsay Tested-by: John Estabrook Signed-off-by: Mike Travis --- arch/x86/platform/uv/bios_uv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- linux-3.12.orig/arch/x86/platform/uv/bios_uv.c +++ linux-3.12/arch/x86/platform/uv/bios_uv.c @@ -201,11 +201,12 @@ void uv_bios_init(void) } if (uv_systab->revision >= UV_SYSTAB_VERSION_UV4) { + int size = uv_systab->size; + iounmap(uv_systab); - uv_systab = ioremap(efi.uv_systab, uv_systab->size); + uv_systab = ioremap(efi.uv_systab, size); if (!uv_systab) { - pr_err("UV: UVsystab: ioremap(%d) failed!\n", - uv_systab->size); + pr_err("UV: UVsystab: ioremap(%d) failed!\n", size); return; } } --