drivers: modem: wncm14a2a: fully release TCP context
TCP contexts are referenced twice, once for the app and once for the stack. Since TCP stack is not used for offload, unref a second time to release the context. Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
This commit is contained in:
parent
4962bf3875
commit
a757832110
|
@ -1792,6 +1792,14 @@ static int offload_put(struct net_context *context)
|
||||||
sock->context->send_cb = NULL;
|
sock->context->send_cb = NULL;
|
||||||
socket_put(sock);
|
socket_put(sock);
|
||||||
net_context_unref(context);
|
net_context_unref(context);
|
||||||
|
if (sock->type == SOCK_STREAM) {
|
||||||
|
/* TCP contexts are referenced twice,
|
||||||
|
* once for the app and once for the stack.
|
||||||
|
* Since TCP stack is not used for offload,
|
||||||
|
* unref a second time.
|
||||||
|
*/
|
||||||
|
net_context_unref(context);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue