From 741324d73c825a8d1f2b9083a3579de0cd1e9593 Mon Sep 17 00:00:00 2001 From: yintao Date: Thu, 2 Jan 2025 19:24:28 +0800 Subject: [PATCH] net/rpmsg: add err handle when rpmsg_socket_unbind called After waiting, it is necessary to check if the connection has been disconnected Signed-off-by: yintao --- net/rpmsg/rpmsg_sockif.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/rpmsg/rpmsg_sockif.c b/net/rpmsg/rpmsg_sockif.c index f046d667b5d..ca46fe73774 100644 --- a/net/rpmsg/rpmsg_sockif.c +++ b/net/rpmsg/rpmsg_sockif.c @@ -778,6 +778,10 @@ static int rpmsg_socket_connect_internal(FAR struct socket *psock) ret = net_sem_timedwait(&conn->sendsem, _SO_TIMEOUT(conn->sconn.s_sndtimeo)); + if (!conn->ept.rdev || conn->unbind) + { + ret = -ECONNRESET; + } if (ret < 0) {