diff options
| author | Ed Maste <emaste@FreeBSD.org> | 2017-11-10 21:26:44 +0000 |
|---|---|---|
| committer | Ed Maste <emaste@FreeBSD.org> | 2017-11-10 21:26:44 +0000 |
| commit | dacbdb94eff3cc698c120f1698456604e05ef977 (patch) | |
| tree | c7df62d9abafc5bfc516d70d5e6537e699d4309c /sys/boot | |
| parent | 28fe4b67afbc60b39780c825bc0c3b71c51628ec (diff) | |
Notes
Diffstat (limited to 'sys/boot')
| -rw-r--r-- | sys/boot/efi/boot1/boot1.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/sys/boot/efi/boot1/boot1.c b/sys/boot/efi/boot1/boot1.c index e2152f52bc0e..71723fe74448 100644 --- a/sys/boot/efi/boot1/boot1.c +++ b/sys/boot/efi/boot1/boot1.c @@ -460,22 +460,23 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) imgpath = NULL; if (status == EFI_SUCCESS) { text = efi_devpath_name(img->FilePath); - printf(" Load Path: %S\n", text); - efi_setenv_freebsd_wcs("Boot1Path", text); - efi_free_devpath_name(text); - - status = BS->HandleProtocol(img->DeviceHandle, &DevicePathGUID, - (void **)&imgpath); - if (status != EFI_SUCCESS) { - DPRINTF("Failed to get image DevicePath (%lu)\n", - EFI_ERROR_CODE(status)); - } else { - text = efi_devpath_name(imgpath); - printf(" Load Device: %S\n", text); - efi_setenv_freebsd_wcs("Boot1Dev", text); + if (text != NULL) { + printf(" Load Path: %S\n", text); + efi_setenv_freebsd_wcs("Boot1Path", text); efi_free_devpath_name(text); - } + status = BS->HandleProtocol(img->DeviceHandle, + &DevicePathGUID, (void **)&imgpath); + if (status != EFI_SUCCESS) { + DPRINTF("Failed to get image DevicePath (%lu)\n", + EFI_ERROR_CODE(status)); + } else { + text = efi_devpath_name(imgpath); + printf(" Load Device: %S\n", text); + efi_setenv_freebsd_wcs("Boot1Dev", text); + efi_free_devpath_name(text); + } + } } /* Get all the device handles */ |
