Skip to content

Commit

Permalink
Merge tag 'efi-urgent-for-v5.13-rc2' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…linux/kernel/git/efi/efi into efi/urgent

Pull EFI fixes for v5.13-rc from Ard Biesheuvel:

  "A handful of low urgency EFI fixes accumulated over the past couple of
   months."

Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Ingo Molnar committed May 23, 2021
2 parents 4ff2473 + 942859d commit e169fba
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
4 changes: 1 addition & 3 deletions drivers/firmware/efi/cper.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,7 @@ static int cper_dimm_err_location(struct cper_mem_err_compact *mem, char *msg)
if (!msg || !(mem->validation_bits & CPER_MEM_VALID_MODULE_HANDLE))
return 0;

n = 0;
len = CPER_REC_LEN - 1;
len = CPER_REC_LEN;
dmi_memdev_name(mem->mem_dev_handle, &bank, &device);
if (bank && device)
n = snprintf(msg, len, "DIMM location: %s %s ", bank, device);
Expand All @@ -286,7 +285,6 @@ static int cper_dimm_err_location(struct cper_mem_err_compact *mem, char *msg)
"DIMM location: not present. DMI handle: 0x%.4x ",
mem->mem_dev_handle);

msg[n] = '\0';
return n;
}

Expand Down
3 changes: 3 additions & 0 deletions drivers/firmware/efi/fdtparams.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ u64 __init efi_get_fdt_params(struct efi_memory_map_data *mm)
BUILD_BUG_ON(ARRAY_SIZE(target) != ARRAY_SIZE(name));
BUILD_BUG_ON(ARRAY_SIZE(target) != ARRAY_SIZE(dt_params[0].params));

if (!fdt)
return 0;

for (i = 0; i < ARRAY_SIZE(dt_params); i++) {
node = fdt_path_offset(fdt, dt_params[i].path);
if (node < 0)
Expand Down
2 changes: 1 addition & 1 deletion drivers/firmware/efi/libstub/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static int find_file_option(const efi_char16_t *cmdline, int cmdline_len,
return 0;

/* Skip any leading slashes */
while (cmdline[i] == L'/' || cmdline[i] == L'\\')
while (i < cmdline_len && (cmdline[i] == L'/' || cmdline[i] == L'\\'))
i++;

while (--result_len > 0 && i < cmdline_len) {
Expand Down
5 changes: 0 additions & 5 deletions drivers/firmware/efi/memattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ static bool entry_is_valid(const efi_memory_desc_t *in, efi_memory_desc_t *out)
return false;
}

if (!(in->attribute & (EFI_MEMORY_RO | EFI_MEMORY_XP))) {
pr_warn("Entry attributes invalid: RO and XP bits both cleared\n");
return false;
}

if (PAGE_SIZE > EFI_PAGE_SIZE &&
(!PAGE_ALIGNED(in->phys_addr) ||
!PAGE_ALIGNED(in->num_pages << EFI_PAGE_SHIFT))) {
Expand Down

0 comments on commit e169fba

Please sign in to comment.