From patchwork Mon Mar 18 08:18:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guido Kiener X-Patchwork-Id: 10856923 Return-Path: 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 3A8726C2 for ; Mon, 18 Mar 2019 07:19:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 177442921A for ; Mon, 18 Mar 2019 07:19:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AB152927C; Mon, 18 Mar 2019 07:19:58 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC5482921A for ; Mon, 18 Mar 2019 07:19:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727182AbfCRHT5 (ORCPT ); Mon, 18 Mar 2019 03:19:57 -0400 Received: from mr05.mx01.tldhost.de ([62.108.36.228]:33729 "EHLO mr05.mx01.tldhost.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726135AbfCRHT5 (ORCPT ); Mon, 18 Mar 2019 03:19:57 -0400 Received: from mx01.tldhost.de (localhost [127.0.0.1]) by mx01.tldhost.de (Postfix) with ESMTP id 33E1E120CDF for ; Mon, 18 Mar 2019 08:19:55 +0100 (CET) Received: by mx01.tldhost.de (Postfix, from userid 1001) id 28476120CD9; Mon, 18 Mar 2019 08:19:55 +0100 (CET) Received: from server12.tldhost.de (server12.tldhost.de [84.19.26.112]) by mx01.tldhost.de (Postfix) with ESMTPS id A821B120CD9; Mon, 18 Mar 2019 08:19:53 +0100 (CET) From: Guido Kiener To: Felipe Balbi , linux-usb@vger.kernel.org, guido.kiener@rohde-schwarz.com, Alan Stern Cc: Guido Kiener Subject: [PATCH v2 3/3] usb: gadget: net2272: Fix net2272_dequeue() Date: Mon, 18 Mar 2019 09:18:34 +0100 Message-Id: <20190318081834.4601-3-guido@kiener-muenchen.de> In-Reply-To: <20190318081834.4601-1-guido@kiener-muenchen.de> References: <20190318081834.4601-1-guido@kiener-muenchen.de> X-PPP-Message-ID: <20190318071953.6848.72450@server12.tldhost.de> X-PPP-Vhost: kiener-muenchen.de X-POWERED-BY: TLDHost.de - AV:CLEAN SPAM:OK Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Restore the status of ep->stopped in function net2272_dequeue(). When the given request is not found in the endpoint queue the function returns -EINVAL without restoring the state of ep->stopped. Thus the endpoint keeps blocked and does not transfer any data anymore. This fix is only compile-tested, since we do not have a corresponding hardware. An analogous fix was tested in the sibling driver. See "usb: gadget: net2280: Fix net2280_dequeue()" Signed-off-by: Guido Kiener Acked-by: Alan Stern --- drivers/usb/gadget/udc/net2272.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c index b77f3126580e..c2011cd7df8c 100644 --- a/drivers/usb/gadget/udc/net2272.c +++ b/drivers/usb/gadget/udc/net2272.c @@ -945,6 +945,7 @@ net2272_dequeue(struct usb_ep *_ep, struct usb_request *_req) break; } if (&req->req != _req) { + ep->stopped = stopped; spin_unlock_irqrestore(&ep->dev->lock, flags); return -EINVAL; }