Skip to content

Commit 429257a

Browse files
author
Ingo Molnar
committed
Merge tag 'efi-urgent-for-v5.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi into efi/urgent
Pull EFI fixes from Ard Biesheuvel: "- another missing RT_PROP table related fix, to ensure that the efivarfs pseudo filesystem fails gracefully if variable services are unsupported - use the correct alignment for literal EFI GUIDs - fix a use after unmap issue in the memreserve code" Signed-off-by: Ingo Molnar <[email protected]>
2 parents 1e28eed + fb98cc0 commit 429257a

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

drivers/firmware/efi/efi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ int __ref efi_mem_reserve_persistent(phys_addr_t addr, u64 size)
927927
}
928928

929929
/* first try to find a slot in an existing linked list entry */
930-
for (prsv = efi_memreserve_root->next; prsv; prsv = rsv->next) {
930+
for (prsv = efi_memreserve_root->next; prsv; ) {
931931
rsv = memremap(prsv, sizeof(*rsv), MEMREMAP_WB);
932932
index = atomic_fetch_add_unless(&rsv->count, 1, rsv->size);
933933
if (index < rsv->size) {
@@ -937,6 +937,7 @@ int __ref efi_mem_reserve_persistent(phys_addr_t addr, u64 size)
937937
memunmap(rsv);
938938
return efi_mem_reserve_iomem(addr, size);
939939
}
940+
prsv = rsv->next;
940941
memunmap(rsv);
941942
}
942943

drivers/firmware/efi/vars.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,10 @@ int efivar_init(int (*func)(efi_char16_t *, efi_guid_t, unsigned long, void *),
484484
}
485485
}
486486

487+
break;
488+
case EFI_UNSUPPORTED:
489+
err = -EOPNOTSUPP;
490+
status = EFI_NOT_FOUND;
487491
break;
488492
case EFI_NOT_FOUND:
489493
break;

include/linux/efi.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@ typedef void *efi_handle_t;
7272
*/
7373
typedef guid_t efi_guid_t __aligned(__alignof__(u32));
7474

75-
#define EFI_GUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \
76-
GUID_INIT(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)
75+
#define EFI_GUID(a, b, c, d...) (efi_guid_t){ { \
76+
(a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
77+
(b) & 0xff, ((b) >> 8) & 0xff, \
78+
(c) & 0xff, ((c) >> 8) & 0xff, d } }
7779

7880
/*
7981
* Generic EFI table header

0 commit comments

Comments
 (0)