mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-18 05:28:36 -07:00
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: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
99f08100cd
commit
c1b71a1df6
1 changed files with 4 additions and 0 deletions
|
|
@ -225,6 +225,10 @@ static int usbredir_write(void *priv, uint8_t *data, int count)
|
||||||
{
|
{
|
||||||
USBRedirDevice *dev = priv;
|
USBRedirDevice *dev = priv;
|
||||||
|
|
||||||
|
if (!dev->cs->opened) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return qemu_chr_fe_write(dev->cs, data, count);
|
return qemu_chr_fe_write(dev->cs, data, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue