x86/platform/UV: Fix bug with iounmap() of the UV4 EFI System Table causing a crash
[deliverable/linux.git] / arch / x86 / platform / uv / bios_uv.c
index 66b2166ea4a1c715a0362ed99cbeb3692a031476..4e9fd1378aec2e6284893c417ef6cf9ab4c28b48 100644 (file)
@@ -199,12 +199,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;
                }
        }
This page took 0.037105 seconds and 5 git commands to generate.