efi_handle_t mem_handle = NULL, handle;
struct efi_device_path *file_path = NULL;
struct efi_device_path *msg_path;
- efi_status_t ret, ret2;
+ efi_status_t ret;
u16 *load_options;
if (!bootefi_device_path || !bootefi_image_path) {
ret = do_bootefi_exec(handle, load_options);
out:
- ret2 = efi_uninstall_multiple_protocol_interfaces(mem_handle,
- &efi_guid_device_path,
- file_path, NULL);
+ if (mem_handle) {
+ efi_status_t r;
+
+ r = efi_uninstall_multiple_protocol_interfaces(
+ mem_handle, &efi_guid_device_path, file_path, NULL);
+ if (r != EFI_SUCCESS)
+ log_err("Uninstalling protocol interfaces failed\n");
+ }
efi_free_pool(file_path);
- return (ret != EFI_SUCCESS) ? ret : ret2;
+
+ return ret;
}
/**