diff options
author | Dave Young <dyoung@redhat.com> | 2014-08-14 05:15:29 -0400 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2014-10-03 13:40:59 -0400 |
commit | 88f8abd594082b9c08789e8527e4e38116a963ec (patch) | |
tree | dd8c8c0e51307e30663d87968ef3913ff063172f /arch/arm64 | |
parent | 5ae3683c380e78aebc60d710617ba2c0dccc9e84 (diff) |
arm64/efi: uefi_init error handling fix
There's one early memmap leak in uefi_init error path, fix it and
slightly tune the error handling code.
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Mark Salter <msalter@redhat.com>
Reported-by: Will Deacon <will.deacon@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/kernel/efi.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c index e72f3100958f..6ed0362dd579 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c | |||
@@ -89,7 +89,8 @@ static int __init uefi_init(void) | |||
89 | */ | 89 | */ |
90 | if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) { | 90 | if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) { |
91 | pr_err("System table signature incorrect\n"); | 91 | pr_err("System table signature incorrect\n"); |
92 | return -EINVAL; | 92 | retval = -EINVAL; |
93 | goto out; | ||
93 | } | 94 | } |
94 | if ((efi.systab->hdr.revision >> 16) < 2) | 95 | if ((efi.systab->hdr.revision >> 16) < 2) |
95 | pr_warn("Warning: EFI system table version %d.%02d, expected 2.00 or greater\n", | 96 | pr_warn("Warning: EFI system table version %d.%02d, expected 2.00 or greater\n", |
@@ -103,6 +104,7 @@ static int __init uefi_init(void) | |||
103 | for (i = 0; i < (int) sizeof(vendor) - 1 && *c16; ++i) | 104 | for (i = 0; i < (int) sizeof(vendor) - 1 && *c16; ++i) |
104 | vendor[i] = c16[i]; | 105 | vendor[i] = c16[i]; |
105 | vendor[i] = '\0'; | 106 | vendor[i] = '\0'; |
107 | early_memunmap(c16, sizeof(vendor)); | ||
106 | } | 108 | } |
107 | 109 | ||
108 | pr_info("EFI v%u.%.02u by %s\n", | 110 | pr_info("EFI v%u.%.02u by %s\n", |
@@ -113,9 +115,8 @@ static int __init uefi_init(void) | |||
113 | if (retval == 0) | 115 | if (retval == 0) |
114 | set_bit(EFI_CONFIG_TABLES, &efi.flags); | 116 | set_bit(EFI_CONFIG_TABLES, &efi.flags); |
115 | 117 | ||
116 | early_memunmap(c16, sizeof(vendor)); | 118 | out: |
117 | early_memunmap(efi.systab, sizeof(efi_system_table_t)); | 119 | early_memunmap(efi.systab, sizeof(efi_system_table_t)); |
118 | |||
119 | return retval; | 120 | return retval; |
120 | } | 121 | } |
121 | 122 | ||