net: context: fix return with held lock
An internal early return left a mutex locked. See https://habr.com/en/company/pvs-studio/blog/495284/ fragment 15. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
parent
7bdc235775
commit
55daa79ba3
1 changed files with 2 additions and 1 deletions
|
@ -907,7 +907,8 @@ int net_context_connect(struct net_context *context,
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_NET_SOCKETS_PACKET) &&
|
if (IS_ENABLED(CONFIG_NET_SOCKETS_PACKET) &&
|
||||||
addr->sa_family == AF_PACKET) {
|
addr->sa_family == AF_PACKET) {
|
||||||
return -EOPNOTSUPP;
|
ret = -EOPNOTSUPP;
|
||||||
|
goto unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (net_context_get_state(context) == NET_CONTEXT_LISTENING) {
|
if (net_context_get_state(context) == NET_CONTEXT_LISTENING) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue