Skip to content

Commit ddbcef4

Browse files
mike-scottcarlescufi
authored andcommitted
net: context: fix semaphore for offload in in net_context_put()
We're missing a k_sem_give for contexts_lock in the CONFIG_NET_OFFLOAD path of net_context_put(). This fixes a network hang which occurs after any http_close() call when CONFIG_NET_OFFLOAD is enabled. Signed-off-by: Michael Scott <[email protected]>
1 parent 423c8df commit ddbcef4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

subsys/net/ip/net_context.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,7 @@ int net_context_put(struct net_context *context)
658658
if (net_if_is_ip_offloaded(net_context_get_iface(context))) {
659659
k_sem_take(&contexts_lock, K_FOREVER);
660660
context->flags &= ~NET_CONTEXT_IN_USE;
661+
k_sem_give(&contexts_lock);
661662
return net_offload_put(
662663
net_context_get_iface(context), context);
663664
}

0 commit comments

Comments
 (0)