diff options
author | Warner Losh <imp@FreeBSD.org> | 2018-01-15 22:17:34 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2018-01-15 22:17:34 +0000 |
commit | 96c4f2c537869c9854f15b23dff6747d2a06f1f8 (patch) | |
tree | 9adde3e4599a2dbbc2ba1d7d5ee3bdd97a28716f /stand/efi/boot1/boot1.c | |
parent | 27d95c1a0311d2d1b181df222cd531b67a61802e (diff) | |
download | src-96c4f2c537869c9854f15b23dff6747d2a06f1f8.tar.gz src-96c4f2c537869c9854f15b23dff6747d2a06f1f8.zip |
Check the return value from utf8_to_ucs2 instead of whether or not uv
is NULL. That's more correct and doesn't depend on the error behavior
of utf8_to_ucs2. In practice, we'll never see this though since we
pass utf8_to_ucs2 a well formed string.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D13918
Notes
Notes:
svn path=/head/; revision=328030
Diffstat (limited to 'stand/efi/boot1/boot1.c')
-rw-r--r-- | stand/efi/boot1/boot1.c | 3 |
1 files changed, 1 insertions, 2 deletions
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, |