diff options
| author | Hans de Goede <hdegoede@redhat.com> | 2011-08-11 12:11:16 +0200 |
|---|---|---|
| committer | Hans de Goede <hdegoede@redhat.com> | 2011-08-29 11:32:03 +0200 |
| commit | 3d364c571a219a6c84c81e66509191ae1730a5cb (patch) | |
| tree | 365988170d7faa88799d32d0f2e1c6cb60b7ab66 | |
| parent | 52f8b1967102b6011a73b9eb4c61b710898b8648 (diff) | |
usb-redir: Don't try to write to the chardev after a close eventqemu-kvm-0.15.0-usbredir
Sicne 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 do a qemu_chr_write on a closed
chardev.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
| -rw-r--r-- | usb-redir.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usb-redir.c b/usb-redir.c index 6d8f98688..732ddab18 100644 --- a/usb-redir.c +++ b/usb-redir.c @@ -226,7 +226,7 @@ static int usbredir_write(void *priv, uint8_t *data, int count) USBRedirDevice *dev = priv; int r; - if (dev->cs->write_blocked) { + if (!dev->cs->opened || dev->cs->write_blocked) { return 0; } |
