summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2021-01-07 14:09:41 -0800
committerBenjamin Kaduk <bkaduk@akamai.com>2021-02-18 13:38:20 -0800
commita12c6442f24a32867c971b6feb5db61d01b02c1f (patch)
treef9575107add548bc1a4cbd4d0e432aa99a07edb9 /crypto
parentb6de54b2c1062f15819174784d9bd53c85c432d3 (diff)
Close /dev/crypto file descriptor after CRIOGET ioctl().
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Ben Kaduk <kaduk@mit.edu> (cherry picked from commit 3ddf44ea5a2c1c8c55f4f4072a611791c79d4e7c) Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13853)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/engine/eng_devcrypto.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/engine/eng_devcrypto.c b/crypto/engine/eng_devcrypto.c
index f03c017181..997271e150 100644
--- a/crypto/engine/eng_devcrypto.c
+++ b/crypto/engine/eng_devcrypto.c
@@ -771,9 +771,11 @@ void engine_load_devcrypto_int()
#ifdef CRIOGET
if (ioctl(fd, CRIOGET, &cfd) < 0) {
fprintf(stderr, "Could not create crypto fd: %s\n", strerror(errno));
+ close(fd);
cfd = -1;
return;
}
+ close(fd);
#else
cfd = fd;
#endif