Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp461323pxb; Thu, 9 Sep 2021 05:07:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0S5PulMi7Y5CODGZnpuG/70rb2Wk2N1Jt/08kQDgOXY5QoaI+LqPKTV6kw/suo8X1CCQl X-Received: by 2002:a05:6e02:1a0e:: with SMTP id s14mr2031621ild.49.1631189244480; Thu, 09 Sep 2021 05:07:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631189244; cv=none; d=google.com; s=arc-20160816; b=rUCYLFWyV0n+KXJ/ryZ+4RhOPz6aZ8UGGQj/Q0y1rlYrn0w5B8ubb25OGc00jNcVv7 Qn2VMe/5CjOcnuPjuTo+fmelz5myfXV+6a1JN0kpOtAx9sqSuFoFNeHW+MloGI0JnxMk hwmEUJTOcJYzfPf1dq0Kh+euENIYbeXhpwhvJMO2gF4Bo2Ia3x3Mbvs3sD7bcHr9GAbk ctxPePRbpExwa1kmnSQr4TraD2TVBalQWABKvASeaqKc9nl7u/w3t5QabYs0QKs8Gw5i ynlnacVXH88IWYlk/l6X/I4X6SrtgafAFDy62K7+ZQ41JCJAhQM7pFZwIgOW8SfwcRdB wjlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+ukZtbLhKhPP3huKtvKOEGgc5Gj5/un/1TviWzaiRmM=; b=LzaAesUfRXGPFAYbH1Bf7NwmqVNgwDAhPAgTOW1KCm7rMNOaA2xPFpHJ0cLTXGSNdv lQNqd2OuhMBFvx8dgvLjUC4m4bkcGSiOofPn7LFEXHIPW3sdjuyfg2uagJ54ozEFnkPL 3mB7zGTKa8A5TkdW9YX97EWN8aqOefag8WwluJw0jcos2HLKPKLuoDAsr7DJKSsBPiIA 56Pc3ZpHscOWkygAuhyi6c+IL872sQH5ep1ZKVydsRgpm+jdqQYQYQVCaUhkAcfhzzsJ NaM8kmPr/c2jYKwmaVygVRnAvF2nF8/ur3s1eMMGpdmd6EQ8hyuybsBZE/kkGbCBcGuE f8hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a8R4HU19; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id d3si1712528ilu.98.2021.09.09.05.07.06; Thu, 09 Sep 2021 05:07:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a8R4HU19; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S237641AbhIIMGK (ORCPT + 99 others); Thu, 9 Sep 2021 08:06:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:43172 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244556AbhIIMBE (ORCPT ); Thu, 9 Sep 2021 08:01:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 85C2C61504; Thu, 9 Sep 2021 11:46:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631187978; bh=FRlfRcOfgCtOTdfU3QTC244vJyhczVbj6UOvqJ//CIQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a8R4HU19NYWPD/GaAYT+gqb7yCeu2s7auiTJmliG4BKxOQjrScsmWDjZ2A82RsGCi XaRBbeu/J3QZxcUF8q3xIQ8i438+8xS6IRzn5b2RinDrxy6d2AwpmZi42GN7hq659U qInhGrRlVhJ2UB5CGXiJkhpdUTtv1QTCwAkHfVlVFQRlK8Z/TodPYe8aLKu4QjMCFl IOTtaMkBFNvuhSuYQ+xCjZNziyQnb54Ov2RuNkQ5r1HBVRzXTRiXyPuwq8IvZydTX7 Pj/3eih71fpS/T4vCORVwqvbH/Jtl/GcApS6V9MaPytO8ya7dbz1582ICSVVKkqJzR pyMxZQeld/GLA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Rui Miguel Silva , Dietmar Eggemann , Greg Kroah-Hartman , Sasha Levin , linux-usb@vger.kernel.org Subject: [PATCH AUTOSEL 5.14 240/252] usb: isp1760: fix qtd fill length Date: Thu, 9 Sep 2021 07:40:54 -0400 Message-Id: <20210909114106.141462-240-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909114106.141462-1-sashal@kernel.org> References: <20210909114106.141462-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rui Miguel Silva [ Upstream commit cbfa3effdf5c2d411c9ce9820f3d33d77bc4697d ] When trying to send bulks bigger than the biggest block size we need to split them over several qtd. Fix this limiting the maximum qtd size to largest block size. Reported-by: Dietmar Eggemann Tested-by: Dietmar Eggemann Signed-off-by: Rui Miguel Silva Link: https://lore.kernel.org/r/20210827131154.4151862-3-rui.silva@linaro.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/isp1760/isp1760-hcd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c index ffb3a0c8c909..d2d19548241e 100644 --- a/drivers/usb/isp1760/isp1760-hcd.c +++ b/drivers/usb/isp1760/isp1760-hcd.c @@ -1826,9 +1826,11 @@ static void packetize_urb(struct usb_hcd *hcd, goto cleanup; if (len > mem->blocks_size[ISP176x_BLOCK_NUM - 1]) - len = mem->blocks_size[ISP176x_BLOCK_NUM - 1]; + this_qtd_len = mem->blocks_size[ISP176x_BLOCK_NUM - 1]; + else + this_qtd_len = len; - this_qtd_len = qtd_fill(qtd, buf, len); + this_qtd_len = qtd_fill(qtd, buf, this_qtd_len); list_add_tail(&qtd->qtd_list, head); len -= this_qtd_len; -- 2.30.2