Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1971023pxb; Thu, 16 Sep 2021 22:00:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwstgrMXzRKjMl1wOqAhYhlk+YqU6dJ/EOBtLFcvp3YyqbZ+02hk6L6kyQbM71JURE8Xtl6 X-Received: by 2002:a17:906:c2cf:: with SMTP id ch15mr10134314ejb.107.1631854817652; Thu, 16 Sep 2021 22:00:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631854817; cv=none; d=google.com; s=arc-20160816; b=J+w27bcBSoLkEuxql/4M8lR/Mc6ovv8JorbQiLxD2mUG6GMW7BAPdd7Sw6gEB8//CG +VyqQgOZ9lJf5rDVPL6AXmFHRKr08prc3sn+beaIhix793whYU8ZW99sD5mRiRN/yZ6Q hcysR3o3cKUQcBUu+naxbhSgkXkzFIHcB3RNNPQ/riXNVoh91O2w3GaD3+LuBylqNY6y qNsZeplyLDkua1w4XtCgrOb3YbJ0QN/1oPh8rivPgNUPbDjNhoPPQm9fK0M5WcsOq4Zi Ui8maeKNPz6hZnozDnebPwFkee32jQo1up3VXrmWbDea1JAUBmCz7dymKX2wMt36t6Wx Y/1g== 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=cVxl0W8aHqmQO1S+V1mKNt5ao+4v62VmVje4HpTDgYWffsRUjT3WfaH45ICjY7OqV0 gVvYTSjZgfls1+dCx9JLZyCvNZ1XA/zRD9pr6WQJUc28AvA3Osc6a+pF8rLC5vZaNKMW 2U5GkFhlqw5fr+rOqc4uffY5Rc/DzCY1KPSQx//igNwibolYI0TKDej2F6DGYTaFz+km p/Z4oZ+gIEB0YNeVMloDEzrTF3b+xW8bVTgTx22EFbN9kl/WNnKpKODLRAMFvNqITQWR ZjCEccYcwfLbZSedc96/GucX48XLYzQQ8MoLZXp27SoGq9xm31QXEy/kNWNTKovVyVLN ZP8g== 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 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n15si5742242edd.445.2021.09.16.21.59.53; Thu, 16 Sep 2021 22:00:17 -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=@linuxfoundation.org header.s=korg header.b=x4MCBBII; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356295AbhIPRtg (ORCPT + 99 others); Thu, 16 Sep 2021 13:49:36 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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; -- 2.30.2