diff options
-rw-r--r-- | src/boot/efi/disk.c | 10 | ||||
-rw-r--r-- | src/boot/efi/xbootldr.c | 7 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/boot/efi/disk.c b/src/boot/efi/disk.c index b7beac3d08..fcd5812ff1 100644 --- a/src/boot/efi/disk.c +++ b/src/boot/efi/disk.c @@ -7,16 +7,18 @@ #include "util.h" EFI_STATUS disk_get_part_uuid(EFI_HANDLE *handle, CHAR16 uuid[static 37]) { + EFI_STATUS err; EFI_DEVICE_PATH *device_path; _cleanup_freepool_ EFI_DEVICE_PATH *paths = NULL; + /* export the device path this image is started from */ + if (!handle) return EFI_NOT_FOUND; - /* export the device path this image is started from */ - device_path = DevicePathFromHandle(handle); - if (!device_path) - return EFI_NOT_FOUND; + err = BS->HandleProtocol(handle, &DevicePathProtocol, (void **) &device_path); + if (err != EFI_SUCCESS) + return err; paths = UnpackDevicePath(device_path); for (EFI_DEVICE_PATH *path = paths; !IsDevicePathEnd(path); path = NextDevicePathNode(path)) { diff --git a/src/boot/efi/xbootldr.c b/src/boot/efi/xbootldr.c index 583bc4216f..84e443135c 100644 --- a/src/boot/efi/xbootldr.c +++ b/src/boot/efi/xbootldr.c @@ -154,9 +154,10 @@ static EFI_STATUS find_device(EFI_HANDLE *device, EFI_DEVICE_PATH **ret_device_p assert(device); assert(ret_device_path); - EFI_DEVICE_PATH *partition_path = DevicePathFromHandle(device); - if (!partition_path) - return EFI_NOT_FOUND; + EFI_DEVICE_PATH *partition_path; + err = BS->HandleProtocol(device, &DevicePathProtocol, (void **) &partition_path); + if (err != EFI_SUCCESS) + return err; /* Find the (last) partition node itself. */ EFI_DEVICE_PATH *part_node = NULL; |