From: Hans de Goede Date: Fri, 15 Mar 2013 10:52:37 +0000 (+0100) Subject: usb-redir: Fix crash on migration with no client connected X-Git-Tag: v1.4.2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b90fd157f7e1e210c845f18e4c1c09343a5cce9d;p=thirdparty%2Fqemu.git 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. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann (cherry picked from commit 3713e1485e6eace7d48b9c790602cfd92c616e5f) Signed-off-by: Michael Roth --- diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 8c0ead07c5f..1406e3fd6f1 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -1985,6 +1985,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;