net: context: Init context state after unref
When the context is freed, we must set the state to UNCONNECTED. Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
35d28fb567
commit
c0682a9dca
1 changed files with 2 additions and 0 deletions
|
@ -398,6 +398,8 @@ int net_context_unref(struct net_context *context)
|
|||
context->conn_handler = NULL;
|
||||
}
|
||||
|
||||
net_context_set_state(context, NET_CONTEXT_UNCONNECTED);
|
||||
|
||||
context->flags &= ~NET_CONTEXT_IN_USE;
|
||||
|
||||
NET_DBG("Context %p released", context);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue