From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTWqv-0004Er-UL for qemu-devel@nongnu.org; Wed, 31 Oct 2012 07:53:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTWqs-0005SB-29 for qemu-devel@nongnu.org; Wed, 31 Oct 2012 07:52:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43188) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTWqr-0005Rx-Pm for qemu-devel@nongnu.org; Wed, 31 Oct 2012 07:52:53 -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 q9VBqq6x031030 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 31 Oct 2012 07:52:52 -0400 From: Hans de Goede Date: Wed, 31 Oct 2012 12:54:35 +0100 Message-Id: <1351684477-12213-1-git-send-email-hdegoede@redhat.com> Subject: [Qemu-devel] [PATCH 0/2] uhci: Don't crash on device disconnect List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org My recent uhci cleanup series has introduced a regression, where qemu sometimes crashes on a device disconnect. The problem is that the uhci code never checked for a device not / no longer existing, instead it was relying on usb_handle_packet accepting a NULL device. But since we now pass usb_handle_packet q->ep->dev, rather then just a local dev variable, we crash as q->ep == NULL due to the device no longer existing. This patch-set fixes this. Note that this patch-set also improves over the old behavior were we would: 1) create a queue for the device/ep 2) create an async for the packet 3) have usb_handle_packet fail 4) destroy the async 5) wait for the queue to be idle for 32 frames 6) destroy the queue Which was rather sub-optimal. Regards, Hans