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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 1458CC4BA24 for ; Thu, 27 Feb 2020 10:05:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DB26C24687 for ; Thu, 27 Feb 2020 10:05:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582797933; bh=0VNzvXG0N1lpr53N0Zscsez3pRAWIFO1xjT1ZLfVrZ8=; h=Subject:To:Cc:From:Date:List-ID:From; b=Ef/P4jUsbZ2+l5+qOq4sH3IIo4Xm1iklpkvwMEj3zY1Y4mTLvzlqaJqg2VVy1qoDH B468cV9RPkzkNEvopBGSE78Gex0FYW0Vvr53uR37lgELQxX3sAqDhXkiZ0WxsuHdRf jOk5E4We/SY0xUspZ7M+wmMQiAL9QgLjLkvxRiEo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728645AbgB0KFd (ORCPT ); Thu, 27 Feb 2020 05:05:33 -0500 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:60537 "EHLO wout1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728630AbgB0KFd (ORCPT ); Thu, 27 Feb 2020 05:05:33 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 2F76D63D; Thu, 27 Feb 2020 05:05:32 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 27 Feb 2020 05:05:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=g71PCV 0lkVW9lSb4xXEqFOfJzhNhHBLfQksQEWzdpB4=; b=u+Lw5ThJ4MbVyU0H/+pE8j 5Q+lEU+df+/DS7DVxJcv2rqa/I2zov9kBcw2xD+u7mK9J4nMyq8aB9aDfqkn7sBp QkCGFf1zL91VwiNedRHEI0gBrxJzNLuzJJz1VCLFiyBwlNvvSosjLcLvDotMVPFJ rBcAUXVfLPH4o83dEJQ4hrQzxVQVKQKZ/U8IW68Nt1GAaodXSY6Rze8e1d3OS7io 2MjBucYEvT1WpR+71fB+Xa9x6PnbaeAZgI7jyWFDBn0JcoxMfrMbECanJPCHKlmt n6iVBVAZkxPBOG1+wpfWJ6yNzRUUIxSo0f2017EmTo4SEm/KRjLc0vwpA64eXu3w == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrleeigdduvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertddttd flnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhg qeenucfkphepkeefrdekiedrkeelrddutdejnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepghhrvghgsehkrhhorghhrdgtohhm X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 640973060FCB; Thu, 27 Feb 2020 05:05:31 -0500 (EST) Subject: FAILED: patch "[PATCH] usb: dwc2: Fix in ISOC request length checking" failed to apply to 4.14-stable tree To: Minas.Harutyunyan@synopsys.com, balbi@kernel.org, hminas@synopsys.com Cc: From: Date: Thu, 27 Feb 2020 11:05:30 +0100 Message-ID: <158279793077241@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.14-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 860ef6cd3f90b84a1832f8a6485c90c34d3b588b Mon Sep 17 00:00:00 2001 From: Minas Harutyunyan Date: Tue, 21 Jan 2020 14:24:04 +0400 Subject: [PATCH] usb: dwc2: Fix in ISOC request length checking Moved ISOC request length checking from dwc2_hsotg_start_req() function to dwc2_hsotg_ep_queue(). Fixes: 4fca54aa58293 ("usb: gadget: s3c-hsotg: add multi count support") Signed-off-by: Minas Harutyunyan Signed-off-by: Felipe Balbi diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 88f7d6d4ff2d..7b40cf5bdc2f 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -1083,11 +1083,6 @@ static void dwc2_hsotg_start_req(struct dwc2_hsotg *hsotg, else packets = 1; /* send one packet if length is zero. */ - if (hs_ep->isochronous && length > (hs_ep->mc * hs_ep->ep.maxpacket)) { - dev_err(hsotg->dev, "req length > maxpacket*mc\n"); - return; - } - if (dir_in && index != 0) if (hs_ep->isochronous) epsize = DXEPTSIZ_MC(packets); @@ -1391,6 +1386,13 @@ static int dwc2_hsotg_ep_queue(struct usb_ep *ep, struct usb_request *req, req->actual = 0; req->status = -EINPROGRESS; + /* Don't queue ISOC request if length greater than mps*mc */ + if (hs_ep->isochronous && + req->length > (hs_ep->mc * hs_ep->ep.maxpacket)) { + dev_err(hs->dev, "req length > maxpacket*mc\n"); + return -EINVAL; + } + /* In DDMA mode for ISOC's don't queue request if length greater * than descriptor limits. */