提交 c1b71a1d 编写于 作者: H Hans de Goede 提交者: Anthony Liguori

usb-redir: Don't try to write to the chardev after a close event

Since we handle close async in a bh, do_write and thus write can get
called after receiving a close event. This patch adds a check to
the usb-redir write callback to not call qemu_chr_fe_write on a closed
backend.
Signed-off-by: NHans de Goede <hdegoede@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 99f08100
......@@ -225,6 +225,10 @@ static int usbredir_write(void *priv, uint8_t *data, int count)
{
USBRedirDevice *dev = priv;
if (!dev->cs->opened) {
return 0;
}
return qemu_chr_fe_write(dev->cs, data, count);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册