diff --git a/stand/efi/boot1/boot1.c b/stand/efi/boot1/boot1.c index 80bfda8e4ff..e88242cdd97 100644 --- a/stand/efi/boot1/boot1.c +++ b/stand/efi/boot1/boot1.c @@ -89,8 +89,8 @@ efi_getenv(EFI_GUID *g, const char *v, void *data, size_t *len) UINTN dl; EFI_STATUS rv; - utf8_to_ucs2(v, &uv, &ul); - if (uv == NULL) + uv = NULL; + if (utf8_to_ucs2(v, &uv, &ul) != 0) return (EFI_OUT_OF_RESOURCES); dl = *len; rv = RS->GetVariable(uv, g, &attr, &dl, data);