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.

This commit is contained in:
Gregory Nutt 2015-05-12 07:28:26 -06:00
parent 04a409aba0
commit 2fcb93d2ca
1 changed files with 8 additions and 1 deletions

View File

@ -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", ndbg("ERROR: Failed to create FIFOs for %s: %d\n",
client->lc_path, ret); client->lc_path, ret);
net_unlock(state);
return ret; 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", ndbg("ERROR: Failed to open write-only FIFOs for %s: %d\n",
client->lc_path, ret); client->lc_path, ret);
net_unlock(state);
goto errout_with_fifos; goto errout_with_fifos;
} }
@ -293,8 +297,11 @@ int psock_local_connect(FAR struct socket *psock,
_SS_ISNONBLOCK(psock->s_flags), _SS_ISNONBLOCK(psock->s_flags),
state); state);
} }
else
{
net_unlock(state);
}
net_unlock(state);
return ret; return ret;
} }
} }