Message ID | 1549460216-25808-2-git-send-email-liam.merwick@oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 29EFB746 for <patchwork-qemu-devel@patchwork.kernel.org>; Wed, 6 Feb 2019 13:38:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 15926297CF for <patchwork-qemu-devel@patchwork.kernel.org>; Wed, 6 Feb 2019 13:38:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0440F295E5; Wed, 6 Feb 2019 13:38:52 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BFDBF2A8E3 for <patchwork-qemu-devel@patchwork.kernel.org>; Wed, 6 Feb 2019 13:38:47 +0000 (UTC) Received: from localhost ([127.0.0.1]:51105 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org>) id 1grNPa-00068i-T6 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 06 Feb 2019 08:38:46 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <liam.merwick@oracle.com>) id 1grNO9-00050T-JF for qemu-devel@nongnu.org; Wed, 06 Feb 2019 08:37:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <liam.merwick@oracle.com>) id 1grNO8-0003m3-Ti for qemu-devel@nongnu.org; Wed, 06 Feb 2019 08:37:17 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:56764) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <liam.merwick@oracle.com>) id 1grNO8-0003lm-LI for qemu-devel@nongnu.org; Wed, 06 Feb 2019 08:37:16 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x16DT0Au150716; Wed, 6 Feb 2019 13:37:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=D5Pgzct5jAQOq5pVf2BGEwiQEtgXEBqNu9FKbcbQBD0=; b=kaFcsQADo71mwtq0y0+LrO3JxKA/dx6s450A9THLmqLI8/Wpak+PCFUanLV9LiwTRhyD 5SGHQfntddsef7f8vP+ORSBqEj9ontLEw7f4F3LE61MG4JYD4NxfjpPx+Hu4kWmeiSlr zCmyXBt30N1XjeqfUF0ix2peF5PutwJrkBWVW3TjCrwL1Z9P4yHtvH3Xqqfkh7nPY+Ef IjbM5wb3zYYCzMI8V0NVRFyrhDAVMoY+H6DeyyfV6vaJapePSBLitOQ7XbEyJMRsygUt QbYcuimNHkPSTUDUyS46meZyKheKkKmwASdfYcSr/91x7lsyzsgUo9y5Ze3p0D+iExge wg== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2qd9argyps-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 06 Feb 2019 13:37:15 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x16Db9su013189 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 6 Feb 2019 13:37:10 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x16Db9lA010149; Wed, 6 Feb 2019 13:37:09 GMT Received: from ol7.nl.oracle.com (/10.175.12.46) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 06 Feb 2019 05:37:09 -0800 From: Liam Merwick <liam.merwick@oracle.com> To: kraxel@redhat.com, qemu-devel@nongnu.org Date: Wed, 6 Feb 2019 13:36:48 +0000 Message-Id: <1549460216-25808-2-git-send-email-liam.merwick@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1549460216-25808-1-git-send-email-liam.merwick@oracle.com> References: <1549460216-25808-1-git-send-email-liam.merwick@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9158 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=909 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902060107 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.86 Subject: [Qemu-devel] [PATCH v2 1/9] usb: rearrange usb_ep_get() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: darren.kenny@oracle.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
Dealing with Null devices in usb_ep_get()
|
expand
|
diff --git a/hw/usb/core.c b/hw/usb/core.c index 241ae66b1505..bfb7ae67bbf0 100644 --- a/hw/usb/core.c +++ b/hw/usb/core.c @@ -720,12 +720,12 @@ struct USBEndpoint *usb_ep_get(USBDevice *dev, int pid, int ep) if (dev == NULL) { return NULL; } - eps = (pid == USB_TOKEN_IN) ? dev->ep_in : dev->ep_out; if (ep == 0) { return &dev->ep_ctl; } assert(pid == USB_TOKEN_IN || pid == USB_TOKEN_OUT); assert(ep > 0 && ep <= USB_MAX_ENDPOINTS); + eps = (pid == USB_TOKEN_IN) ? dev->ep_in : dev->ep_out; return eps + ep - 1; }