From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754991AbcHATHK (ORCPT ); Mon, 1 Aug 2016 15:07:10 -0400 Received: from relay2.sgi.com ([192.48.180.65]:55725 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754833AbcHATGe (ORCPT ); Mon, 1 Aug 2016 15:06:34 -0400 Message-Id: <20160801184050.250424783@asylum.americas.sgi.com> References: <20160801184049.811754120@asylum.americas.sgi.com> User-Agent: quilt/0.46-1 Date: Mon, 01 Aug 2016 13:40:51 -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 , Alex Thorlton , x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] x86/platform/UV: Fix problem with iounmap 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 Save the size field from the uv_systab struct before doing the iounmap of the struct pointer, to avoid a null dereference error. Reviewed-by: Dimitri Sivanich Reviewed-by: Nathan Zimmer Tested-by: Frank Ramsay Tested-by: John Estabrook Signed-off-by: Mike Travis --- v2: modify description and changelog. --- arch/x86/platform/uv/bios_uv.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- linux.orig/arch/x86/platform/uv/bios_uv.c +++ linux/arch/x86/platform/uv/bios_uv.c @@ -200,12 +200,14 @@ void uv_bios_init(void) return; } + /* Starting with UV4 the UV systab size is variable */ 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; } } --