* [Qemu-devel] [PATCH] usb-redir: Fix crash on migration with no client connected
@ 2013-03-15 10:52 Hans de Goede
0 siblings, 0 replies; only message in thread
From: Hans de Goede @ 2013-03-15 10:52 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: Hans de Goede, qemu-devel
If no client is connected on the src side, then we won't receive a
parser during migrate, in this case usbredir_post_load() should be a nop,
rather then to try to derefefence the NULL dev->parser pointer.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
hw/usb/redirect.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 9ba714d..06d22da 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -2005,6 +2005,10 @@ static int usbredir_post_load(void *priv, int version_id)
{
USBRedirDevice *dev = priv;
+ if (dev->parser == NULL) {
+ return 0;
+ }
+
switch (dev->device_info.speed) {
case usb_redir_speed_low:
dev->dev.speed = USB_SPEED_LOW;
--
1.8.1.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-03-15 10:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-15 10:52 [Qemu-devel] [PATCH] usb-redir: Fix crash on migration with no client connected Hans de Goede
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).