From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46680) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHwwn-0004mQ-Kw for qemu-devel@nongnu.org; Tue, 19 Mar 2013 09:51:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UHwwj-00015B-2w for qemu-devel@nongnu.org; Tue, 19 Mar 2013 09:51:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6275) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHwwi-000151-RP for qemu-devel@nongnu.org; Tue, 19 Mar 2013 09:51:21 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2JDpKot032145 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 19 Mar 2013 09:51:20 -0400 From: Hans de Goede Date: Tue, 19 Mar 2013 14:54:39 +0100 Message-Id: <1363701279-14291-3-git-send-email-hdegoede@redhat.com> In-Reply-To: <1363701279-14291-1-git-send-email-hdegoede@redhat.com> References: <1363701279-14291-1-git-send-email-hdegoede@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] 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 0b2a5e6..e0df74b 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -2006,6 +2006,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