From d40891a14683a9cc8951ad36fb9e09831b7122af Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 10 Apr 2018 21:27:47 +0200 Subject: [PATCH] smbd: Fix CID 1414783 Double unlock The loop is unnecessary, both susv4 as well as the Linux manpage explicitly say: > These functions shall not return an error code of [EINTR]. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source3/smbd/process.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/source3/smbd/process.c b/source3/smbd/process.c index df54a44b8840..f992e65fc904 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -162,15 +162,9 @@ static bool smbd_unlock_socket_internal(struct smbXsrv_connection *xconn) #ifdef HAVE_ROBUST_MUTEXES if (xconn->smb1.echo_handler.socket_mutex != NULL) { - int ret = EINTR; - - while (ret == EINTR) { - ret = pthread_mutex_unlock( - xconn->smb1.echo_handler.socket_mutex); - if (ret == 0) { - break; - } - } + int ret; + ret = pthread_mutex_unlock( + xconn->smb1.echo_handler.socket_mutex); if (ret != 0) { DEBUG(1, ("pthread_mutex_unlock failed: %s\n", strerror(ret))); -- 2.34.1