From 298b4aba0ce0dcaf4f1663e2a2f2099de794556e Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 5 Jun 2022 19:30:49 +0800 Subject: [PATCH] net/tcp: Hold the net lock in tcp_timer_expiry to follow the call convention for d_txavail Signed-off-by: Xiang Xiao --- net/tcp/tcp_timer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/tcp/tcp_timer.c b/net/tcp/tcp_timer.c index 0023221a30..800023dfaa 100644 --- a/net/tcp/tcp_timer.c +++ b/net/tcp/tcp_timer.c @@ -58,6 +58,7 @@ #include #include +#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(); } /****************************************************************************