From cc240d482dcbb6a3cfef3080238c7d4376c40a34 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: May 15 2013 21:06:02 +0000 Subject: Add forgotten patch --- diff --git a/0107-usb-redir-Fix-crash-on-migration-with-no-client-conn.patch b/0107-usb-redir-Fix-crash-on-migration-with-no-client-conn.patch new file mode 100644 index 0000000..c8b87a0 --- /dev/null +++ b/0107-usb-redir-Fix-crash-on-migration-with-no-client-conn.patch @@ -0,0 +1,31 @@ +From 106a39c50211b7c7e96ffb47ad9deae5d9be6d84 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 15 Mar 2013 11:52:37 +0100 +Subject: [PATCH] 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) +--- + hw/usb/redirect.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c +index 4d23b66..bf6aaf0 100644 +--- a/hw/usb/redirect.c ++++ b/hw/usb/redirect.c +@@ -2008,6 +2008,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;