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:
Jukka Rissanen 2017-06-09 14:27:29 +03:00
commit c0682a9dca

View file

@ -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);