summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util/nvmutil/nvmutil.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 8b5c4381..7652538a 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -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];