util/nvmutil: reset errno when writing a MAC

if checksum verification passed, then we should reset
in case we're operating on a given part and the last
one checked was bad.

a catch-all reset is already performed in writeGbe,
but it's good to do it here too.

in practise, if the 2nd part (part 1) is what failed,
errno still wouldn't be reset.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-01-27 05:05:20 +00:00
parent bcf53cc2cc
commit 3e86bf5ce2
+1
View File
@@ -251,6 +251,7 @@ cmd_setmac(void)
for (int partnum = 0; partnum < 2; partnum++) {
if (!goodChecksum(part = partnum))
continue;
errno = 0;
for (int w = 0; w < 3; w++) /* write MAC to gbe part */
setWord(w, partnum, mac[w]);