diff options
author | Hans de Goede <hdegoede@redhat.com> | 2013-03-15 11:52:37 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2013-04-03 09:55:48 +0200 |
commit | 3713e1485e6eace7d48b9c790602cfd92c616e5f (patch) | |
tree | d87d634d4ccc5f941c2af86781f69b0d84c29024 /hw | |
parent | 162cbbd1736de2bca43fdefa7e98c54a361ee60d (diff) | |
download | hqemu-3713e1485e6eace7d48b9c790602cfd92c616e5f.zip hqemu-3713e1485e6eace7d48b9c790602cfd92c616e5f.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>
Diffstat (limited to 'hw')
-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 d02a7b9..cf66df1 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -1973,6 +1973,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; |