summaryrefslogtreecommitdiff
path: root/util/nvmutil
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2022-11-27 00:39:06 +0000
committerLeah Rowe <leah@libreboot.org>2022-11-27 00:39:06 +0000
commitb81b51f98bdbed6a3ce33a67c8eefcfc7adce6d1 (patch)
tree558b30275663264acd06c747ea47c40b3eef87ce /util/nvmutil
parenta94bac81f3186fced1011de861f0e243e31584e0 (diff)
util/nvmutil: remove errant code
Diffstat (limited to 'util/nvmutil')
-rw-r--r--util/nvmutil/nvmutil.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 56477b9a..5ec28949 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -95,8 +95,6 @@ main(int argc, char *argv[])
strMac = strRMac;
else if (strcmp(COMMAND, "swap") == 0)
cmd = &cmd_swap;
- else
- errno = EINVAL;
} else if (argc == 4) {
if (strcmp(COMMAND, "setmac") == 0)
strMac = MAC_ADDRESS;
@@ -109,21 +107,15 @@ main(int argc, char *argv[])
cmd = &cmd_brick;
else if (strcmp(COMMAND, "copy") == 0)
cmd = &cmd_copy;
- else
- errno = EINVAL;
- } else
- errno = EINVAL;
+ }
if (errno != 0)
goto nvmutil_exit;
if (readFromFile(&fd, gbe, FILENAME, flags, SIZE_8KB) != SIZE_8KB)
goto nvmutil_exit;
-
- if (errno == ENOTDIR)
+ else if (errno == ENOTDIR)
errno = 0;
- if (errno != 0)
- goto nvmutil_exit;
if (strMac != NULL)
setmac(strMac);