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>
master
Leah Rowe 2025-01-27 05:05:20 +00:00
parent 67ac52df84
commit 4ea5484e02
1 changed files with 1 additions and 0 deletions

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]);