tcp: Validate net_context_put return code
Validate the return code of net_context_put and add debug information in case any error is detected. This patch fixes the error reported by Coverity: Error handling issues (CHECKED_RETURN) Calling "net_context_put" without checking return value (as is done elsewhere 4 out of 5 times). Coverity-CID: 157833 Change-Id: Ia4a87cc08094bee465c8828411d7c1311481695a Signed-off-by: Flavio Santes <flavio.santes@intel.com>
This commit is contained in:
parent
db04f43931
commit
a8b73aa287
1 changed files with 5 additions and 1 deletions
|
@ -723,10 +723,14 @@ void net_tcp_init(void)
|
|||
static void fin_timeout(struct k_work *work)
|
||||
{
|
||||
struct net_tcp *tcp = CONTAINER_OF(work, struct net_tcp, fin_timer);
|
||||
int rc;
|
||||
|
||||
NET_DBG("Remote peer didn't confirm connection close");
|
||||
|
||||
net_context_put(tcp->context);
|
||||
rc = net_context_put(tcp->context);
|
||||
if (rc < 0) {
|
||||
NET_DBG("Cannot close TCP context");
|
||||
}
|
||||
}
|
||||
|
||||
#if NET_DEBUG
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue