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:
Ryan Erickson 2020-04-28 16:26:27 -05:00 committed by Jukka Rissanen
parent 4962bf3875
commit a757832110

View file

@ -1792,6 +1792,14 @@ static int offload_put(struct net_context *context)
sock->context->send_cb = NULL;
socket_put(sock);
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;
}