efiboot: Duplicate efi_bootdp before we clobber it in efi_net_probe.

Patch from jakllsch@.  Makes Socionext Synquacer boot considerably
more reliably.

PR kern/58075
This commit is contained in:
riastradh 2024-03-28 18:24:57 +00:00
parent cea226e5f0
commit c9c7ef91a2
1 changed files with 3 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: efiboot.c,v 1.22 2021/10/06 10:13:19 jmcneill Exp $ */ /* $NetBSD: efiboot.c,v 1.23 2024/03/28 18:24:57 riastradh Exp $ */
/*- /*-
* Copyright (c) 2018 Jared McNeill <jmcneill@invisible.ca> * Copyright (c) 2018 Jared McNeill <jmcneill@invisible.ca>
@ -86,6 +86,8 @@ efi_main(EFI_HANDLE imageHandle, EFI_SYSTEM_TABLE *systemTable)
status = uefi_call_wrapper(BS->HandleProtocol, 3, efi_li->DeviceHandle, &DevicePathProtocol, (void **)&efi_bootdp); status = uefi_call_wrapper(BS->HandleProtocol, 3, efi_li->DeviceHandle, &DevicePathProtocol, (void **)&efi_bootdp);
if (EFI_ERROR(status)) if (EFI_ERROR(status))
efi_bootdp = NULL; efi_bootdp = NULL;
else
efi_bootdp = DuplicateDevicePath(efi_bootdp);
#ifdef EFIBOOT_DEBUG #ifdef EFIBOOT_DEBUG
Print(L"Loaded image : 0x%" PRIxEFIPTR "\n", efi_li); Print(L"Loaded image : 0x%" PRIxEFIPTR "\n", efi_li);