diff --git a/stand/efi/boot1/boot1.c b/stand/efi/boot1/boot1.c index e88242cdd97a..6fe79f5e6755 100644 --- a/stand/efi/boot1/boot1.c +++ b/stand/efi/boot1/boot1.c @@ -106,8 +106,7 @@ efi_setenv_freebsd_wcs(const char *varname, CHAR16 *valstr) size_t len; EFI_STATUS rv; - utf8_to_ucs2(varname, &var, &len); - if (var == NULL) + if (utf8_to_ucs2(varname, &var, &len) != 0) return (EFI_OUT_OF_RESOURCES); rv = RS->SetVariable(var, &FreeBSDBootVarGUID, EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,