loader: Fix shadow_fb allocation

Using AllocateMaxAddress here means that gfx_state->tg_shadow_fb is
treated as the highest address we can receive. Since
gfx_state->tg_shadow_fb is NULL, we never receive anything. Use
AllocateAnyPages instead.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1098

(cherry picked from commit 95f75b0e6e5f71d34e4eef151f43822e33838663)
This commit is contained in:
Ahmad Khalifa 2024-05-31 12:41:32 +03:00 committed by Warner Losh
parent ce02470205
commit 92aa078752

View file

@ -656,7 +656,7 @@ efi_find_framebuffer(teken_gfx_t *gfx_state)
gfx_state->tg_shadow_sz =
EFI_SIZE_TO_PAGES(efifb.fb_height * efifb.fb_width *
sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
status = BS->AllocatePages(AllocateMaxAddress, EfiLoaderData,
status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData,
gfx_state->tg_shadow_sz,
(EFI_PHYSICAL_ADDRESS *)&gfx_state->tg_shadow_fb);
if (status != EFI_SUCCESS)