Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2916726yba; Mon, 22 Apr 2019 15:39:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLkDT5N0MrTDgIYTTt3ydWhHbaB3DJUkvgk9CjrLnN+22x4kSpvHapCRMTTuOdegcei2GO X-Received: by 2002:a63:6fcf:: with SMTP id k198mr21031874pgc.158.1555972784339; Mon, 22 Apr 2019 15:39:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555972784; cv=none; d=google.com; s=arc-20160816; b=Csl+xRkYpxvgxgfkHatHpWnQAT/4NNK7WeuVp6NyMqqC2hx3WEZD3djJ8e8J+jGCCo ivykQUq8O7U2o0PHwJqLIXli7fhLYCsEDSHKvOfYc9x+wIl9/MoH4eoyzvdYXTmhRxFz C4Bu6KjxQN6avRFU4St9duJ7F8KMDkEla0ba9hPIV6eGgKu2U0w8jljFxQqIcTSl9Ywh G6OlEFCm96r1x8hn6YRuK3quPQs21AeabCrGl96KPvLPQ1Z0qmKp8+C0oIUHfQBjUnd8 WBpRt1zzSwjqzXDY5351O1d9BCAlbhNAYwgLxwZR5xMVgIkW1bdfPz5WdRDFMTY2Zz5Y EQZA== 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=amOfNWc3Ql8aA7GWyiKvGfnSMMsUbtwBCes1xPkGEHWqQAR7UGlrD3M4M9V5nkrc+d rs3fFMY1vuwFlx35RWE185rCgHdvPXStI8SMy+bu3siEk0fUdL4Yfvyui8+LSHykAthQ zdS6yYiUu5dAGaauPj5/BYEqJ9sP98dYl5zHIQexHaRwnXQVqIWV0rhzSWWPVcKMOY93 iJM6gO9OomyPFNxD3rgPPKicrMG39y2Swzo4YZvcJpclM+L56isVfAomJ9WIVaXP67C3 OT17RPNrN+xLZgi+iKmM5uPnyGGZ7AsVn6ThGQmXCAKXfS/KvkAJZo4x1fu2rtAZObHZ eSmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aUToCuDb; 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 e3si13170770pgs.37.2019.04.22.15.39.29; Mon, 22 Apr 2019 15:39:44 -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=aUToCuDb; 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 S1729945AbfDVTqO (ORCPT + 99 others); Mon, 22 Apr 2019 15:46:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:48174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729913AbfDVTqF (ORCPT ); Mon, 22 Apr 2019 15:46:05 -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 ED822218FC; Mon, 22 Apr 2019 19:46:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555962364; bh=6Ui+mNxebeUcMct9JOd+3C8FA4FTpDJkta54H57FEFU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aUToCuDbmk8PLp9BOw/TLvUIjjWC7t6V/9tQKbZeJKP5fkWkKHKijZTope4+bm+dS nRpFlp+zRd6OJ5VrufWFL2MgteuQh/XufYBLCL6AL24l91UD6dTcWtcHWcjvNTym8P wrXmqy0BRjgCaIoVts+p3WeQ6k0B6UMGcuFfJX1c= 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.19 24/68] usb: gadget: net2272: Fix net2272_dequeue() Date: Mon, 22 Apr 2019 15:44:32 -0400 Message-Id: <20190422194516.11634-24-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190422194516.11634-1-sashal@kernel.org> References: <20190422194516.11634-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