You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/06/07 17:15:47 UTC
[incubator-nuttx] 01/03: net/tcp: Hold the net lock in tcp_timer_expiry
This is an automated email from the ASF dual-hosted git repository.
pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 298b4aba0ce0dcaf4f1663e2a2f2099de794556e
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Jun 5 19:30:49 2022 +0800
net/tcp: Hold the net lock in tcp_timer_expiry
to follow the call convention for d_txavail
Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
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 <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();
}
/****************************************************************************