From 7d62a749153508a2bab2746de37a4aa7d8357890 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 19 Oct 2017 16:26:09 -0600 Subject: [PATCH] Fix an error introduced in last commit. --- net/tcp/tcp_send_unbuffered.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/tcp/tcp_send_unbuffered.c b/net/tcp/tcp_send_unbuffered.c index 3a610d104e..a431f312f3 100644 --- a/net/tcp/tcp_send_unbuffered.c +++ b/net/tcp/tcp_send_unbuffered.c @@ -396,6 +396,8 @@ static uint16_t tcpsend_eventhandler(FAR struct net_driver_s *dev, else if ((flags & TCP_DISCONN_EVENTS) != 0) { + FAR struct socket *psock = pstate->snd_sock; + ninfo("Lost connection\n"); /* We could get here recursively through the callback actions of @@ -403,11 +405,12 @@ static uint16_t tcpsend_eventhandler(FAR struct net_driver_s *dev, * already been disconnected. */ + DEBUGASSERT(psock != NULL); if (_SS_ISCONNECTED(psock->s_flags)) { /* Report not connected */ - tcp_lost_connection(pstate->snd_sock, pstate->snd_cb, flags); + tcp_lost_connection(psock, pstate->snd_cb, flags); } pstate->snd_sent = -ENOTCONN;