From patchwork Thu Sep 16 16:02:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 513045 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp1445000jao; Thu, 16 Sep 2021 10:44:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsSCJHRUcuUAfUWsjV7T0Dpj2dfOEtaHP497FUnBIIOz/I8H0PgwH1Xx9ZlgQPPP//akpm X-Received: by 2002:a05:6e02:1847:: with SMTP id b7mr4932222ilv.180.1631814292778; Thu, 16 Sep 2021 10:44:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631814292; cv=none; d=google.com; s=arc-20160816; b=UhcQRkcig53yyfGfkJgSZALONQudCywJZD2oRXA/07s9lv1DyeaWjQLvszn9ZMJIoB rmt4sQjUK04wuI0U/B3wPvXOK4eGLaNAhXkdFJPeKEovgkVKbRzsY6TizWRqfqGcdqzm VN1DF0ifAJ+Z/0aqyn3xB4jh5yuwekUKG5z3WiTOMzbvpLGox7FLIUkwjhHQQ2fMHb7P OHSj/4BwxxGxXOZR6thQmcTftZpCe6lJZE6U1qDw3x4JLLpnd2Ist6CGpMycMf8qwO79 wyMCz0QJUgFTc+Zft4BscjOJz2BReqyErIOzNWUg0SF7KDI7AocdvUwCRP3bZlEw1jQX WMbQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+ukZtbLhKhPP3huKtvKOEGgc5Gj5/un/1TviWzaiRmM=; b=oBqx9nZ7Ce6fL8f3/zKCWwcCT5S8m8wsseE8jFX4QlCiwO/btBNRnto3MqMTlbDuG0 P0AKsfuzw6RvdCA6g2C/DaFBvXqElTjQPDDp+vAKxKJ3egPh3J+7zBOqDxFw+bf7mhY+ tmfz52F+U/B95f+jbzDSaYf7ifobxyUyFwBYc0zrWTlsC9+AmltaajF4kzsZFgMaS/t6 K5Z4xZTjAu4bLL58XcBZcL5gNU93f/9t3CnVYEqnYIodGTBRu+YN8rjXHW+51RmTHkz6 WEVvUflqLKpg+UVZiG+XcehOyxoH6fw4vcaULqP2zGZukOJFueeEG/IOSvww1VBgNVuY ZlMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qRuoLn8O; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c184si3522977iof.111.2021.09.16.10.44.52; Thu, 16 Sep 2021 10:44:52 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=@linuxfoundation.org header.s=korg header.b=qRuoLn8O; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355978AbhIPRon (ORCPT + 11 others); Thu, 16 Sep 2021 13:44:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:57088 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355400AbhIPRl0 (ORCPT ); Thu, 16 Sep 2021 13:41:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5A51861351; Thu, 16 Sep 2021 16:52:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631811175; bh=FRlfRcOfgCtOTdfU3QTC244vJyhczVbj6UOvqJ//CIQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qRuoLn8OXisoNocIaCokHitPmQqzyvcFujNp/kLvJjcWz4ABJHbyTxc4LCTqGHPDC 8FiSGKzggTkLSubvL4wt4VjECnjNzaLgf2RV8KGo+z6EvCtd27EzgBUugFY0Cq+ReF PBC/9znbZXPdZvfAbsbfQ76SzIjB9c/y8WsXVKGQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dietmar Eggemann , Rui Miguel Silva , Sasha Levin Subject: [PATCH 5.14 378/432] usb: isp1760: fix qtd fill length Date: Thu, 16 Sep 2021 18:02:07 +0200 Message-Id: <20210916155823.626952602@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155810.813340753@linuxfoundation.org> References: <20210916155810.813340753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@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(-) -- 2.30.2 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;