summaryrefslogtreecommitdiff
path: root/p11-kit/rpc-transport.c
diff options
context:
space:
mode:
Diffstat (limited to 'p11-kit/rpc-transport.c')
-rw-r--r--p11-kit/rpc-transport.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/p11-kit/rpc-transport.c b/p11-kit/rpc-transport.c
index b3651ad..913e054 100644
--- a/p11-kit/rpc-transport.c
+++ b/p11-kit/rpc-transport.c
@@ -360,8 +360,10 @@ rpc_socket_read (rpc_socket *sock,
p11_mutex_lock (&sock->read_lock);
if (!sock->read_creds) {
- if (read_all (sock->fd, &dummy, 1) != 1)
+ if (read_all (sock->fd, &dummy, 1) != 1) {
+ p11_mutex_unlock (&sock->read_lock);
return CKR_DEVICE_ERROR;
+ }
sock->read_creds = true;
}