From 85937f3f4c3f53b281b6a2f453e2273217e42aa1 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 1 Dec 2022 13:16:05 +0000 Subject: util/nvmutil: reset errno on cmd_swap If one of the checksums was valid, but the other was not, errno would be set to E_CANCELED, but then the buffer would be modified anyway; this is acceptable behaviour, and errno would later be reset writing the GBE file, which is done only on the condition that the buffer was modified, but it's also a good idea to reset it here just in case. This is not a bugfix, and no behavioural changes will be observed by the user, but this may *prevent* a bug in the future, so let's pre-fix that bug now. --- util/nvmutil/nvmutil.c | 1 + 1 file changed, 1 insertion(+) (limited to 'util/nvmutil') diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 02f62304..5a28a9a7 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -345,6 +345,7 @@ cmd_swap(void) gbeFileModified = 1; nvmPartModified[0] = 1; nvmPartModified[1] = 1; + errno = 0; } } -- cgit v1.2.1