util/nvmutil: stricter work buf check

check it right after initialisation

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-17 21:43:37 +00:00
parent f5104c5893
commit 6e6b1dd366
+3 -3
View File
@@ -162,16 +162,16 @@ main(int argc, char *argv[])
#endif
nv = new_xstate();
if (nv == NULL)
err(errno, NULL);
if (nv->f.buf == NULL)
err(EINVAL, "Work buffer not initialised");
nv->argv0 = argv[0];
if (argc < 3)
usage();
if (nv->f.buf == NULL)
err(EINVAL, "Work buffer not initialised");
f = &nv->f;
f->fname = argv[1];