net/tcp: Hold the net lock in tcp_timer_expiry

to follow the call convention for d_txavail

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-06-05 19:30:49 +08:00 committed by Petro Karashchenko
parent 5b165a2294
commit 298b4aba0c

View File

@ -58,6 +58,7 @@
#include <nuttx/net/netstats.h>
#include <nuttx/net/tcp.h>
#include "netdev/netdev.h"
#include "devif/devif.h"
#include "socket/socket.h"
#include "tcp/tcp.h"
@ -139,8 +140,10 @@ static void tcp_timer_expiry(FAR void *arg)
{
FAR struct tcp_conn_s *conn = arg;
net_lock();
conn->timeout = true;
conn->dev->d_txavail(conn->dev);
netdev_txnotify_dev(conn->dev);
net_unlock();
}
/****************************************************************************