rpmsg_socket: release tx buffer when send_oncopy failed
@@ -1010,6 +1010,7 @@ static ssize_t rpmsg_socket_send_continuous(FAR struct socket *psock,
conn->ept.dest_addr);
if (ret < 0)
{
+ rpmsg_release_tx_buffer(&conn->ept, msg);
break;
}
@@ -1109,6 +1110,10 @@ static ssize_t rpmsg_socket_send_single(FAR struct socket *psock,
nxmutex_unlock(&conn->sendlock);
ret = rpmsg_sendto_nocopy(&conn->ept, msg, total, conn->ept.dest_addr);
+ if (ret < 0)
+ {
+ rpmsg_release_tx_buffer(&conn->ept, msg);
+ }
return ret > 0 ? len : ret;
}
