From 2fcb93d2ca8ea167b0ca6f9ce8e23d0a3a4f8ad9 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 12 May 2015 07:28:26 -0600 Subject: [PATCH] Correct some network lock logic: Two error conditions where the network was not being unlocked and one where it was getting unlocked twice. From Jussi Kivilinna. --- net/local/local_connect.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/net/local/local_connect.c b/net/local/local_connect.c index bcb819ff969..b4bdc59eb6b 100644 --- a/net/local/local_connect.c +++ b/net/local/local_connect.c @@ -135,6 +135,8 @@ int inline local_stream_connect(FAR struct local_conn_s *client, { ndbg("ERROR: Failed to create FIFOs for %s: %d\n", client->lc_path, ret); + + net_unlock(state); return ret; } @@ -147,6 +149,8 @@ int inline local_stream_connect(FAR struct local_conn_s *client, { ndbg("ERROR: Failed to open write-only FIFOs for %s: %d\n", client->lc_path, ret); + + net_unlock(state); goto errout_with_fifos; } @@ -293,8 +297,11 @@ int psock_local_connect(FAR struct socket *psock, _SS_ISNONBLOCK(psock->s_flags), state); } + else + { + net_unlock(state); + } - net_unlock(state); return ret; } }