Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp460451pxb; Thu, 9 Sep 2021 05:06:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3h3TnbM0BazXxL/N+o3tZKkdJENB6gwfWBp94VqYxLelQar43iaiMzKBxw7GkIIOpP2lu X-Received: by 2002:a02:2452:: with SMTP id q18mr2445615jae.116.1631189189262; Thu, 09 Sep 2021 05:06:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631189189; cv=none; d=google.com; s=arc-20160816; b=EgmZ7Ys3rwy2kItb40zO4h68KsCTT4wd6sv9iHnYYUc1JXHwU8I/ruNy05Suiawqix NedPpfomLfw5Z5bX/rr+S5bUiDb9RNNDz+3AUEhxFm6b4mtbiXfs/d+pwW5OAcvlVQ5e 167DUkH+j3z10rcUdBKDbynxalzo8euF97xYUMkPEYwab+nsEtRva/28I2D3eYth4FmI 8aXbdPclpedvXNOkrKmYHIj0d7IHK1hTRo3+Y3yr/1yTLWSieSMK0+5nl7ays17WFffq NasdFGNUQb+sWvvhh26WuDiMoF+mHYZ64bM3+3OCi4nl8CyE9uUglHtQEtK7dU9z/+xs QBCw== 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=1Wf7Xuzt/8V77YsxltS7chQCaiDw/XxyaReYRW6QCP8=; b=MxFR/OqUD7SiITL2TpoM/wLv+TDjdiUaKZ1/m8biD5sfqjFjgIE5yRyPt0xg6sPnpw shtduXT6xP+zzYjCR7GmaGqLqg+1lnDAa5uBDAsMYReOJdPAceYNad6MS3P6Uwo+frLn iZo/YbEMUYt4BZguZYoH2DyL20IUzxgObBycGk9q3rJY88sQGWc7PKUhPqWGLwf0gHmM XcOKMSXwQNCtDt2gaAMpV/IDR9Zv4er7VMqD9Vnx3YntrxVhGOrgue0a9csvNrjNQMyT TfUQeXgvDc3CZy1nJYNa1so1qXe+J4RYlHGHYuMmh6v2ue6ENwvhvR6M7B7F3ST4zAtJ IXTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pkpcoWf4; 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 g14si1907042jat.122.2021.09.09.05.06.14; Thu, 09 Sep 2021 05:06:29 -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=pkpcoWf4; 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 S238963AbhIIMFy (ORCPT + 99 others); Thu, 9 Sep 2021 08:05:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:43050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244195AbhIIMBC (ORCPT ); Thu, 9 Sep 2021 08:01:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4D1F261423; Thu, 9 Sep 2021 11:46:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631187977; bh=8B59y0L/wT2zvmO07cGzKGTGPzz20BmRT7PsdET3T74=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pkpcoWf46bpT/WVywGNrP2/bdGOK07x8GfYLLlrWz89lXU3TFdcy3VF3iSW5f+5WN JH1TngTZHaww1G5z/vJ705a+OttDIJhpwqkWW+D+X5oCBUSJUs+X+uFIHJm7kjTHpO PjKgadMY2GYeyl+opMQAKR3tOcXrxvRkRBlYGt0TxzIWTsE61rQ6bxV9XyrdbS3qjC J89OkN3ZUiMO6+CwWa0C/PWF2x7fYrPoal4T7B0VU0k3ffNkIrLBK+wWkUpA+d5NRR 9SjDTycwfqIxpLVwGBTDn+3jUCi05AomxiYr+x3clvY2x6S7nQLrKFzUNpvm1Iv0wA SNgnWsHq07Srg== 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 239/252] usb: isp1760: fix memory pool initialization Date: Thu, 9 Sep 2021 07:40:53 -0400 Message-Id: <20210909114106.141462-239-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 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