提交 342f7a9d 编写于 作者: M Marc-André Lureau 提交者: Michael S. Tsirkin

qemu-char: make tcp_chr_disconnect() reentrant-safe

During CHR_EVENT_CLOSED, the function could be reentered, make this
case safe.
Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
上级 6167ebbd
......@@ -2769,6 +2769,10 @@ static void tcp_chr_disconnect(CharDriverState *chr)
{
TCPCharDriver *s = chr->opaque;
if (!s->connected) {
return;
}
s->connected = 0;
if (s->listen_ioc) {
s->listen_tag = qio_channel_add_watch(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册