From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGSCR-0000FV-9B for qemu-devel@nongnu.org; Fri, 15 Mar 2013 06:49:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UGSCQ-0000DV-9z for qemu-devel@nongnu.org; Fri, 15 Mar 2013 06:49:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62860) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGSCQ-0000DO-1y for qemu-devel@nongnu.org; Fri, 15 Mar 2013 06:49:22 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2FAnK5A030125 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 15 Mar 2013 06:49:20 -0400 From: Hans de Goede Date: Fri, 15 Mar 2013 11:52:37 +0100 Message-Id: <1363344757-11149-1-git-send-email-hdegoede@redhat.com> Subject: [Qemu-devel] [PATCH] usb-redir: Fix crash on migration with no client connected List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Hans de Goede , qemu-devel@nongnu.org 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 --- hw/usb/redirect.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 9ba714d..06d22da 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -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; -- 1.8.1.4