From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B24FAC04E84 for ; Wed, 15 May 2019 11:06:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7C57D21734 for ; Wed, 15 May 2019 11:06:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557918360; bh=Xu3mLlaCcGWBnsMZislL85Ey76Ysj2T/+dXF7TEF1jo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=h0lxziosCeg6HX47DtMpqEN5fBmeUL1gA60brsSLNE2rShL1sp7NM60Or7dLIrIqK 7ecbZaSSrwVVXPGNF/jsFLvlCDrHLENl/kVqV58zEVgenIczuNeIM+I1JyqHj4x9ap +/+DJBJFoJxl+vYHEKMFz0Us3vqc0wFJA9ycWBkQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728174AbfEOLF7 (ORCPT ); Wed, 15 May 2019 07:05:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:35858 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728641AbfEOLFf (ORCPT ); Wed, 15 May 2019 07:05:35 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3ABAF21744; Wed, 15 May 2019 11:05:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557918334; bh=Xu3mLlaCcGWBnsMZislL85Ey76Ysj2T/+dXF7TEF1jo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=puR44IMn2bPn5TYLoija48jp5J+AZ7DrtJLbamD0CiR2tsOssqP7fI8FPm9muWXmy +P5km8FeO0BpJFbRe0Kn/btxjhHleX7WnhRLZIn1d0go1pp+UQiFPtnS5n1jUp4hXC y/ueY4TRmRYUsoIDSFiK/iYnlc4A5tDdDlqC2Ssk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alan Stern , Guido Kiener , Felipe Balbi , "Sasha Levin (Microsoft)" Subject: [PATCH 4.4 094/266] usb: gadget: net2272: Fix net2272_dequeue() Date: Wed, 15 May 2019 12:53:21 +0200 Message-Id: <20190515090725.628353842@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090722.696531131@linuxfoundation.org> References: <20190515090722.696531131@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org [ Upstream commit 091dacc3cc10979ab0422f0a9f7fcc27eee97e69 ] 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()" Acked-by: Alan Stern Signed-off-by: Guido Kiener Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin (Microsoft) --- 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 3b6e34fc032b..553922c3be85 100644 --- a/drivers/usb/gadget/udc/net2272.c +++ b/drivers/usb/gadget/udc/net2272.c @@ -962,6 +962,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; } -- 2.19.1