From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tuidd-00063R-GY for qemu-devel@nongnu.org; Mon, 14 Jan 2013 06:55:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TuidQ-0005N1-Ny for qemu-devel@nongnu.org; Mon, 14 Jan 2013 06:55:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59076) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuidQ-0005Mu-G4 for qemu-devel@nongnu.org; Mon, 14 Jan 2013 06:55:24 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0EBoeZM001064 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 14 Jan 2013 06:50:40 -0500 From: Gerd Hoffmann Date: Mon, 14 Jan 2013 12:50:17 +0100 Message-Id: <1358164219-14070-5-git-send-email-kraxel@redhat.com> In-Reply-To: <1358164219-14070-1-git-send-email-kraxel@redhat.com> References: <1358164219-14070-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 4/6] ehci: Assert state machine is sane w.r.t. EHCIQueue List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Markus Armbruster , Gerd Hoffmann From: Markus Armbruster Coverity worries the EHCIQueue pointer could be null when we pass it to functions that reference it. The state machine ensures it can't be null then. Assert that, to hush the checker. Signed-off-by: Markus Armbruster Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 320b7e7..7040659 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -2092,18 +2092,22 @@ static void ehci_advance_state(EHCIState *ehci, int async) break; case EST_ADVANCEQUEUE: + assert(q != NULL); again = ehci_state_advqueue(q); break; case EST_FETCHQTD: + assert(q != NULL); again = ehci_state_fetchqtd(q); break; case EST_HORIZONTALQH: + assert(q != NULL); again = ehci_state_horizqh(q); break; case EST_EXECUTE: + assert(q != NULL); again = ehci_state_execute(q); if (async) { ehci->async_stepdown = 0; -- 1.7.9.7