summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-01-29 04:45:57 +0000
committerLeah Rowe <leah@libreboot.org>2025-01-29 04:45:57 +0000
commita98490573be7c0ac779cfc3e70220984ece486d5 (patch)
tree2fd086819fd4d3b976e64e7057a437646885c407
parent6b9cf09ca21987363ad11b8396aa4a9ba19a6ee3 (diff)
util/nvmutil: only set mac_updated at the end
after setting the checksum too this is functionally no different, but setting it at the start didn't sit right with me. it's more logically correct to set it at the end, in case any error did not result in an exit. Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--util/nvmutil/nvmutil.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index b016e419..a28a117e 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -268,7 +268,6 @@ cmd_setmac(void)
for (int partnum = 0; partnum < 2; partnum++) {
if (!goodChecksum(part = partnum))
continue;
- mac_updated = 1;
for (int w = 0; w < 3; w++) /* write MAC to gbe part */
setWord(w, partnum, mac[w]);
@@ -277,6 +276,7 @@ cmd_setmac(void)
macf(partnum);
cmd_setchecksum(); /* MAC updated; need valid checksum */
+ mac_updated = 1;
}
if (mac_updated)