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.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, T_DKIMWL_WL_HIGH,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 29F7EC282CE for ; Mon, 22 Apr 2019 19:53:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E0CA1204EC for ; Mon, 22 Apr 2019 19:53:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555962834; bh=OlE9EGt0JosUy4kibLPDfXLauPOGHRga+rH0DaTHdas=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ZBrk3iM+h74lkXTL8Ea9po3zVnKei3fr1/Q/N/SZAXAWrijOac2ASZlKparFnOBX4 /uCnG4LdMzzjWj0DZfHzTp+PV4v2F1KuLopT5rPNsubYyKmE2sNNjdwfnEg7pC0Xfk P66WaY5J//NygMcCyJe+vhF7K1eN/8YCIY5Melqk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730633AbfDVTxr (ORCPT ); Mon, 22 Apr 2019 15:53:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:53768 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730956AbfDVTtz (ORCPT ); Mon, 22 Apr 2019 15:49:55 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9F6B4204EC; Mon, 22 Apr 2019 19:49:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555962594; bh=OlE9EGt0JosUy4kibLPDfXLauPOGHRga+rH0DaTHdas=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K8EA11IFS2YjTNexVX4jcO8SvZMufWOUdZ5qOF7hHNm1gua0KP+KtYHWQMNAiQ5u0 MpzEpSAz/VhHSFeToKf0SYFQ+B7h2MBNg6fefHd8yqOEEoRo9YI+Q7z5KkzfLzTRwR NpekPcZHx1kKs8wqsKoorE67wRK2xRC92R+6lu2A= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Guido Kiener , Guido Kiener , Felipe Balbi , Sasha Levin , linux-usb@vger.kernel.org Subject: [PATCH AUTOSEL 4.4 06/21] usb: gadget: net2272: Fix net2272_dequeue() Date: Mon, 22 Apr 2019 15:49:26 -0400 Message-Id: <20190422194941.13433-6-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190422194941.13433-1-sashal@kernel.org> References: <20190422194941.13433-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Guido Kiener [ 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