From patchwork Thu Sep 16 16:02:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 513046 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp1445033jao; Thu, 16 Sep 2021 10:44:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybvS6PoPmesmUHJAxkdUFfwbBZFdj29xyO0cItQGxBSMlqZ1MWM71I30aB16vgTvyPognj X-Received: by 2002:a05:6e02:154e:: with SMTP id j14mr4902506ilu.226.1631814295028; Thu, 16 Sep 2021 10:44:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631814295; cv=none; d=google.com; s=arc-20160816; b=0I9iaw7iFWQcEQha1Ct265bYY4ipHQ21pyqt9vP6L2GLKHkXgriXXW/YKUrhm+Ae80 NLeS9TgyyjbGgC9QGZLHKywiqot3TbYfMTrIKIXcHd6FsAKQ7Fx/5lCsgkSe25/qQmGr zQYUH0HV1jGXdy90+39MD1evZIskWSmp+MoLU1uqWsqbQcR8gBBCt4xIPCh4jD9lTUAK OOrP6f4RJW62J0PjRwTF7TkxB6m8bhDu967vOkxQU/LvhJvE0hlzJVqwMVzIjz3CC9NS NXoHkXq2Rewb857BtRak8p3JRKcWyglmkX6fir/iTeNoaf6URcVkZVu2fBghVik3CbdO 7JEQ== 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=1Wf7Xuzt/8V77YsxltS7chQCaiDw/XxyaReYRW6QCP8=; b=sBvvZIvzfPgyda6uBcMklTXl9XlM7RDBCUip1D8cYmc7NJLvIir8sswjvelE/kmRyF WrtDX6QwVOYQ6gzYv4zFq/Tl8vrH1JxUtcDFUn+A9LMD7ofDSkM5PK5CgeH4ezIGK0jb qiJ0qVMkivWZXVQoBwIbDDYII6/jubeDCh5lHznZlVbhDFe6BLtshZQSyvnq3PlL6DVK Uwz5MctMGvONoufQf5s3Y/gdGLQFP02qv6lFTgYj0IqKBKfu/VR8BmM4hzoP32+j8ysu ujHtZ0BnQerKT9VHb+EwubCgDsVZrUEgrCPaoHky71ySGpl1bb2gK4Dsv6v3fPYQVbg1 C9Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=x4MCBBII; 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.54; Thu, 16 Sep 2021 10:44:55 -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=x4MCBBII; 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 S1355987AbhIPRoo (ORCPT + 11 others); Thu, 16 Sep 2021 13:44:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:57086 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355399AbhIPRl0 (ORCPT ); Thu, 16 Sep 2021 13:41:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 93EB761357; Thu, 16 Sep 2021 16:52:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631811173; bh=8B59y0L/wT2zvmO07cGzKGTGPzz20BmRT7PsdET3T74=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x4MCBBII86dMRu67RIkpDPrdIn3GiCf6vu0H/N0odJdETPZiJxvo3p9LvSMKwMKk4 B7WtXG6QUaxldiOgFfHcBEhdxmNUnmcOKVedMwEenKJvK7SIOpGyYq33ufhKQUU2If 7uc7YEexg7V0wamLyDcuBYR5FAyxszCevQ1sEGV0= 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 377/432] usb: isp1760: fix memory pool initialization Date: Thu, 16 Sep 2021 18:02:06 +0200 Message-Id: <20210916155823.594534994@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 f757f9291f920e1da4c6cfd4064c6bf59639983e ] The loops to setup the memory pool were skipping some blocks, that was not visible on the ISP1763 because it has fewer blocks than the ISP1761. But won testing on that IP from the family that would be an issue. Reported-by: Dietmar Eggemann Tested-by: Dietmar Eggemann Signed-off-by: Rui Miguel Silva Link: https://lore.kernel.org/r/20210827131154.4151862-2-rui.silva@linaro.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/isp1760/isp1760-hcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.30.2 diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c index 27168b4a4ef2..ffb3a0c8c909 100644 --- a/drivers/usb/isp1760/isp1760-hcd.c +++ b/drivers/usb/isp1760/isp1760-hcd.c @@ -588,8 +588,8 @@ static void init_memory(struct isp1760_hcd *priv) payload_addr = PAYLOAD_OFFSET; - for (i = 0, curr = 0; i < ARRAY_SIZE(mem->blocks); i++) { - for (j = 0; j < mem->blocks[i]; j++, curr++) { + for (i = 0, curr = 0; i < ARRAY_SIZE(mem->blocks); i++, curr += j) { + for (j = 0; j < mem->blocks[i]; j++) { priv->memory_pool[curr + j].start = payload_addr; priv->memory_pool[curr + j].size = mem->blocks_size[i]; priv->memory_pool[curr + j].free = 1;