Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2830185yba; Mon, 22 Apr 2019 13:51:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZnPDsQxy9RQhkkvyQWbogLQdx2zUkh+l3pQXgfXhjcouHUtrl5nx5ShmaqZ6L0htVAWle X-Received: by 2002:a63:1364:: with SMTP id 36mr16096271pgt.436.1555966271897; Mon, 22 Apr 2019 13:51:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555966271; cv=none; d=google.com; s=arc-20160816; b=sp4j1+PuAeh0NAgf6hwlw5IBAHuSbHsmBh5n71TuAInLe5A+cMjtlPEwycbF9C3iMH wgAOI80dwg6HJHDPg3PCPAxfBEwoUIq74XHqGdRmX954AanDEju9BV14iEodlHsX3oo+ vFYcgg0fyH8PIFgJ444Aprb0saclti/oY/xkXqpX68y3crNJz2+k2IhA4/It7GElPbNK S+ahjtCnvEkYFQq4f3GzPABpIvKID/40qC4X7/S0I6qH6HS0Y6jjbgSfLddOISZoLIL6 IwNY00PkUH9FggxfSjBamosLykvb8HOAx4aSO64idnSovXav8w6R+ZMUSQ2vSWYDV8/L jD6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5YRQeI9P4KKnZFkBO0IPRlLOqU6V3WYgfVXr9rprBgg=; b=SFpZVBN5+h+5iibfKep0EB1oQNYhws0AjMIU1Uxg9fatSvYvgLhTmdQNbXFDGgTe3P PkTH/AaRwaAOEZxSIW+BSouyoK7oloCzQ49jAB4iQxiKuosv+9q+Mrr0uQMBvv3sIzjK 1Iq6c3RABI+f5PSP2Wo0xSLW01tIjWi/4Cl6ygBDInPnuLVQH+WpIlVSdgRsCnqgeene meFuEBoWf4qrgWkscvlzwhXFrZBev3RsulvRhvTTcHdEFM+0oGyWeHq9fq7BH/FjeF28 /iZnBY4kJq7lh9By8wocjOideyEMc+VIsVJHlpEiuCYGASBRc8TK9qlz6Tl8PL6wCYJf GsEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xCo2EyAJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c14si14109430pls.106.2019.04.22.13.50.56; Mon, 22 Apr 2019 13:51:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xCo2EyAJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729082AbfDVTnF (ORCPT + 99 others); Mon, 22 Apr 2019 15:43:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:43556 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729036AbfDVTnD (ORCPT ); Mon, 22 Apr 2019 15:43:03 -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 964AA2177B; Mon, 22 Apr 2019 19:43:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555962182; bh=6Ui+mNxebeUcMct9JOd+3C8FA4FTpDJkta54H57FEFU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xCo2EyAJbBX6mRHRTT5gNJWPin2OaEA6NujyGkkmZc6ZYiUHpHVIcf41vLRhfrSQe Ar1dEXDdph8oBR8amastyOnZn4Y1eKXPZLabw02ncCI43vExAc3rVrXPYtTNZxbvRJ JgXBSFzm/96URLPfKCXbaXBEAeLXnpMMdlQ+m4Z0= 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 5.0 33/98] usb: gadget: net2272: Fix net2272_dequeue() Date: Mon, 22 Apr 2019 15:41:00 -0400 Message-Id: <20190422194205.10404-33-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190422194205.10404-1-sashal@kernel.org> References: <20190422194205.10404-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 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; } -- 2.19.1