summaryrefslogtreecommitdiff
path: root/util/nvmutil
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-08 03:22:50 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-08 03:22:50 +0000
commitec3ab4059cd3e2d4e74e3d23f91a942f5e3a9767 (patch)
treec46d86012dfd44eefb18eb1380a038002ebc2533 /util/nvmutil
parent63fcc0891f2a2cef9a5c92b1ac17afce9fe53ad5 (diff)
util/nvmutil: close random_fd only if usedHEADmaster
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil')
-rw-r--r--util/nvmutil/nvmutil.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 9191f2ea..c6193d9e 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -267,8 +267,10 @@ main(int argc, char *argv[])
if (close(gbe_fd) == -1)
err(ECANCELED, "close '%s'", fname);
#ifndef HAVE_ARC4RANDOM_BUF
- if (close(urandom_fd) == -1)
- err(ECANCELED, "close '%s'", rname);
+ if (urandom_fd > -1) {
+ if (close(urandom_fd) == -1)
+ err(ECANCELED, "close '%s'", rname);
+ }
#endif
/*