diff options
-rw-r--r-- | src/lib/libcrypto/engine/hw_cryptodev.c | 4 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/engine/hw_cryptodev.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/libcrypto/engine/hw_cryptodev.c b/src/lib/libcrypto/engine/hw_cryptodev.c index 924e379ab5..d3b186c132 100644 --- a/src/lib/libcrypto/engine/hw_cryptodev.c +++ b/src/lib/libcrypto/engine/hw_cryptodev.c | |||
@@ -193,8 +193,10 @@ get_dev_crypto(void) | |||
193 | 193 | ||
194 | if ((fd = open_dev_crypto()) == -1) | 194 | if ((fd = open_dev_crypto()) == -1) |
195 | return (-1); | 195 | return (-1); |
196 | if (ioctl(fd, CRIOGET, &retfd) == -1) | 196 | if (ioctl(fd, CRIOGET, &retfd) == -1) { |
197 | close(fd); | ||
197 | return (-1); | 198 | return (-1); |
199 | } | ||
198 | 200 | ||
199 | /* close on exec */ | 201 | /* close on exec */ |
200 | if (fcntl(retfd, F_SETFD, 1) == -1) { | 202 | if (fcntl(retfd, F_SETFD, 1) == -1) { |
diff --git a/src/lib/libssl/src/crypto/engine/hw_cryptodev.c b/src/lib/libssl/src/crypto/engine/hw_cryptodev.c index 924e379ab5..d3b186c132 100644 --- a/src/lib/libssl/src/crypto/engine/hw_cryptodev.c +++ b/src/lib/libssl/src/crypto/engine/hw_cryptodev.c | |||
@@ -193,8 +193,10 @@ get_dev_crypto(void) | |||
193 | 193 | ||
194 | if ((fd = open_dev_crypto()) == -1) | 194 | if ((fd = open_dev_crypto()) == -1) |
195 | return (-1); | 195 | return (-1); |
196 | if (ioctl(fd, CRIOGET, &retfd) == -1) | 196 | if (ioctl(fd, CRIOGET, &retfd) == -1) { |
197 | close(fd); | ||
197 | return (-1); | 198 | return (-1); |
199 | } | ||
198 | 200 | ||
199 | /* close on exec */ | 201 | /* close on exec */ |
200 | if (fcntl(retfd, F_SETFD, 1) == -1) { | 202 | if (fcntl(retfd, F_SETFD, 1) == -1) { |