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 43167C4BA24 for ; Thu, 27 Feb 2020 10:05:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1A5FD24680 for ; Thu, 27 Feb 2020 10:05:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582797943; bh=HBVQtPcSq7AjhOvaPffSEjeDURS5LceNSnDHtBs/XFU=; h=Subject:To:Cc:From:Date:List-ID:From; b=xure3Hsp6Z1dvNUbUmyx8h6ExuyFjBCeu9r7BVVNpapz2RpB/DK+7p3I7JpzNLVhM ZrddoaabEczAcXNl7Cmc0EUilJeQRwmYlAWMu7t5+vZ0HZcygPeG+D6mnSXxAE9AhS 9BPT8ccspVBfQPR7+LroajCo5BsRMQB7E/WRBiNs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728653AbgB0KFm (ORCPT ); Thu, 27 Feb 2020 05:05:42 -0500 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:49105 "EHLO wout1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728630AbgB0KFm (ORCPT ); Thu, 27 Feb 2020 05:05:42 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id C7DCA6A4; Thu, 27 Feb 2020 05:05:41 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 27 Feb 2020 05:05:42 -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=wqYg6x Q0KMeFx3/wH/OBd3QaA/wufNYxIIbkmma3GR4=; b=cE1q0UG+lZRc4TFHbLmPOG Ir9nT0475F/Y1MfAodSY7ENR6iFY9g4Xazc/1i/ZWFC4Vc6XNkfyh0OSYtVh9cjZ cq+mU2UWnq9HWbXc1tCyPaEEcb+wuPp4W08g/j+wrxtHyW3RHQ2BFgq01gidZRRn 9hEhfLPjjQEfdiemVNWfuPKqhlauSqOlVPDjf6axZEXqa1qsZNAGQtPcdsFu9vro gs3cDxizmpmnGOQf9LssCE9oCkn60bpfThpbW2TO52/uNrXPtlSkmc42DvHdZrma z/eoGXsmOppcP8z8FyBfeMzIgXhAMo6Rzcdih3WD9IYPOsAOjLQrXx7stdB+YyHg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrleeigdduvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertddttd flnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhg qeenucfkphepkeefrdekiedrkeelrddutdejnecuvehluhhsthgvrhfuihiivgepudenuc 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 11AB23280065; Thu, 27 Feb 2020 05:05:40 -0500 (EST) Subject: FAILED: patch "[PATCH] usb: dwc2: Fix in ISOC request length checking" failed to apply to 4.4-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: <158279793024521@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.4-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. */