From patchwork Wed Feb 22 10:56:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 9586603 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 930096020B for ; Wed, 22 Feb 2017 10:57:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7CB5D2793A for ; Wed, 22 Feb 2017 10:57:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7067B27D29; Wed, 22 Feb 2017 10:57:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 97BA32793A for ; Wed, 22 Feb 2017 10:57:14 +0000 (UTC) Received: from localhost ([::1]:51399 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgUbh-00085x-Nb for patchwork-qemu-devel@patchwork.kernel.org; Wed, 22 Feb 2017 05:57:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgUbG-0007xS-Uw for qemu-devel@nongnu.org; Wed, 22 Feb 2017 05:56:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgUbC-0007LO-0g for qemu-devel@nongnu.org; Wed, 22 Feb 2017 05:56:47 -0500 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:33087) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cgUbB-0007Kv-Pp for qemu-devel@nongnu.org; Wed, 22 Feb 2017 05:56:41 -0500 Received: by mail-wr0-x244.google.com with SMTP id s27so1005372wrb.0 for ; Wed, 22 Feb 2017 02:56:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=bYIh/gKNlEDsdNycMeeflHQ2hyLI8TIw5U4LbVROFps=; b=jzcBkq0D5U7ZSCbPk6d5hAGhbzHe6L2rOlWbIZL+1YlwQuEdt5FSClDjM0nLAmZu4e IR2ILgOTnHCsUtGnpvc5zkoaehA/6tu1AB9wJBiEModka9cutEQ+eI96iCIsltoK4xBC 6atDKshcC42+/n1bdPT1zXBHpBgdx1yrSgoerrLuiw1AlBKerUWoZPUXm6WMWM+ONIyc +8nM08mc8XlToroYTzyrXYZB+jz1TcO3768esaw+/CgX5Ogc4xNN5v0WJRNVR+GDe2iI bFVtPWB5U5JxEVx3HYK3h9DbwCNGervRjyab1apUOnpbnfwXKsh4F9L69GOpIk9tMcrM iZlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=bYIh/gKNlEDsdNycMeeflHQ2hyLI8TIw5U4LbVROFps=; b=ZQ+VMIbxI7LwX87Jscnofc7zY5rjaAyks14J3s6t5Rr4OcEWeCORcFsnUz4FJ3uPEn wZlQbmeWKVH5tlQHF032hXDfonX0OXj3jNuXj8OQZYljF2ZbE7xqFos+m+arxZpa5lwN DWE3KbBJCu16waYnwa5WKX0tjP17AyVlv24w1GQXz74HQFICNtp8V0A2zUyJDnFhO4Xx gAtswX4yH8gqv6t72BrhxCYdbqgAynJGqBP8xz8ySWlPUwwztIH64pcEsAgI8ldY+eX1 L6lSZKs9F2MReDldxf9dZ8QzbMByiyxOUj80D717/jJQ/06mRVJULDpSDMbbFiRLQkAJ WJZw== X-Gm-Message-State: AMke39lCEZqwsiBFoANEqER1lzS6XghDS6z/ZFYtOoutnhocKr6W6QdLHo9OrF+exQ0jqg== X-Received: by 10.223.150.73 with SMTP id c9mr26782201wra.19.1487760999257; Wed, 22 Feb 2017 02:56:39 -0800 (PST) Received: from localhost.localdomain.localdomain ([104.192.110.250]) by smtp.gmail.com with ESMTPSA id e16sm1251444wra.36.2017.02.22.02.56.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Feb 2017 02:56:38 -0800 (PST) From: Li Qiang X-Google-Original-From: Li Qiang To: kraxel@redhat.com, qemu-devel@nongnu.org Date: Wed, 22 Feb 2017 02:56:30 -0800 Message-Id: <1487760990-115925-1-git-send-email-liqiang6-s@360.cn> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c0c::244 Subject: [Qemu-devel] [PATCH] usb: ohci: fix error return code in servicing td X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Li Qiang , ppandit@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP It should return 1 if an error occurs when reading td. This will avoid an infinite loop issue in ohci_service_ed_list. Signed-off-by: Li Qiang Reviewed-by: Philippe Mathieu-Daudé --- hw/usb/hcd-ohci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index 21c93e0..fe8406a 100644 --- a/hw/usb/hcd-ohci.c +++ b/hw/usb/hcd-ohci.c @@ -1001,7 +1001,7 @@ static int ohci_service_td(OHCIState *ohci, struct ohci_ed *ed) if (ohci_read_td(ohci, addr, &td)) { trace_usb_ohci_td_read_error(addr); ohci_die(ohci); - return 0; + return 1; } dir = OHCI_BM(ed->flags, ED_D);