aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/efivarfs/create-read.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/efivarfs/create-read.c')
-rw-r--r--tools/testing/selftests/efivarfs/create-read.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/efivarfs/create-read.c b/tools/testing/selftests/efivarfs/create-read.c
index 9674a19396a3..7bc7af4eb2c1 100644
--- a/tools/testing/selftests/efivarfs/create-read.c
+++ b/tools/testing/selftests/efivarfs/create-read.c
@@ -32,8 +32,10 @@ int main(int argc, char **argv)
rc = read(fd, buf, sizeof(buf));
if (rc != 0) {
fprintf(stderr, "Reading a new var should return EOF\n");
+ close(fd);
return EXIT_FAILURE;
}
+ close(fd);
return EXIT_SUCCESS;
}