diff options
author | Hans de Goede <hdegoede@redhat.com> | 2013-03-15 11:52:37 +0100 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2013-05-16 12:06:36 -0500 |
commit | b90fd157f7e1e210c845f18e4c1c09343a5cce9d (patch) | |
tree | 9843858197ad6a56b280ea1845044db60e34d07f | |
parent | 7322cb17faca8af3abe480bf16587a6b83c1bc7d (diff) | |
download | qemu-b90fd157f7e1e210c845f18e4c1c09343a5cce9d.tar.gz |
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 <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 3713e1485e6eace7d48b9c790602cfd92c616e5f)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r-- | hw/usb/redirect.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 8c0ead07c5..1406e3fd6f 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; |