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
parent
67ac52df84
commit
4ea5484e02
|
@ -251,6 +251,7 @@ cmd_setmac(void)
|
||||||
for (int partnum = 0; partnum < 2; partnum++) {
|
for (int partnum = 0; partnum < 2; partnum++) {
|
||||||
if (!goodChecksum(part = partnum))
|
if (!goodChecksum(part = partnum))
|
||||||
continue;
|
continue;
|
||||||
|
errno = 0;
|
||||||
|
|
||||||
for (int w = 0; w < 3; w++) /* write MAC to gbe part */
|
for (int w = 0; w < 3; w++) /* write MAC to gbe part */
|
||||||
setWord(w, partnum, mac[w]);
|
setWord(w, partnum, mac[w]);
|
||||||
|
|
Loading…
Reference in New Issue