From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNKEN-0007Lx-2c for qemu-devel@nongnu.org; Wed, 03 Apr 2013 05:43:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNKEJ-0003OE-Ul for qemu-devel@nongnu.org; Wed, 03 Apr 2013 05:43:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12420) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNKEJ-0003Nd-M6 for qemu-devel@nongnu.org; Wed, 03 Apr 2013 05:43:43 -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 r339hgmK028322 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 3 Apr 2013 05:43:42 -0400 From: Gerd Hoffmann Date: Wed, 3 Apr 2013 11:43:31 +0200 Message-Id: <1364982220-4755-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1364982220-4755-1-git-send-email-kraxel@redhat.com> References: <1364982220-4755-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 01/10] usb-redir: Fix crash on migration with no client connected List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hans de Goede , Gerd Hoffmann From: Hans de Goede 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 --- hw/usb/redirect.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 1.7.9.7