diff --git a/qemu-char.c b/qemu-char.c index 1fbccf02ac0a77e095317bc63f7a5bb8b508c8e2..84eb8a1fb454a6d38ab6d8bae683c8f16cffa4c3 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -2858,6 +2858,10 @@ static void tcp_chr_update_read_handler(CharDriverState *chr) { TCPCharDriver *s = chr->opaque; + if (!s->connected) { + return; + } + remove_fd_in_watch(chr); if (s->ioc) { chr->fd_in_tag = io_add_watch_poll(s->ioc,