In efi_clean_memmap(), we do a pass over the EFI memory map to remove bogus entries that may be returned on certain systems. This recent commit: 1db91035d01aa8bf ("efi: Add tracking for dynamically allocated memmaps") refactored this code to pass the input to efi_memmap_install() via a temporary struct on the stack, which is populated using an initializer which inadvertently defines the value of its size field in terms of its desc_size field, which value cannot be relied upon yet in the initializer itself. Fix this by using efi.memmap.desc_size instead, which is where we get the value for desc_size from in the first place.
Unified · Split
| @@ -308,7 +308,7 @@ static void __init efi_clean_memmap(void) · 307 unmodified lines | ||
| 308 | 308 | .phys_map = efi.memmap.phys_map, |
| 309 | 309 | .desc_version = efi.memmap.desc_version, |
| 310 | 310 | .desc_size = efi.memmap.desc_size, |
| 311 | − .size = data.desc_size * (efi.memmap.nr_map - n_removal), | |
| 311 | + .size = efi.memmap.desc_size * (efi.memmap.nr_map - n_removal), | |
| 312 | 312 | .flags = 0, |
| 313 | 313 | }; |
| 314 | 314 | |