Skip to contentSkip to conversation

usb-redir: Fix crash on migration with no client connected

PATCH New Hans de Goede 1 participant 1 message Mar 15, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb-redir: Fix crash on migration with no client connected

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.

---
 hw/usb/redirect.c | 4 ++++
 1 file changed, 4 insertions(+)
hw/usb/redirect.c +4 -0
index 9ba714d..06d22da 100644
@@ -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;
Signature · 1 line
1.8.1.4