From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 69116482F6; Mon, 1 Apr 2024 17:00:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711990850; cv=none; b=i8RPHAMhnnWv16IH1yAq+8HTOZmBZOXth/C0VZXNPO03oZ3fyF5IzU6IaIIciSlXlunCojS6PELgQ1J6eSuSAl/4Tn2o7jkBEOyoNSjjCcQkvEd573oxYGkLyy9R9Jt60oQ8rFurvNe3OkXMFXsrnRZOlcDBiNTkQYH0OgwtaHY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711990850; c=relaxed/simple; bh=/S/ueUQ5XUCPQj2DwYq4QRORsGYNCTVXwy2k7cV5JYE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Z1Z2aHYTJAb8ktHoN175tcgGdbXdNTrTj1hSB6ZKFITfUVPi8u39H5cBu0a+7c3rWg2uMb9VHD37bDHh1hGR6Oc9jS11+Q3j8Y4Zwcq/MSDegr3fDrOEqO3zjETvk+A5N2yRNnu+3YhbIACXdG0Y1RFEHz6g2eNYOoOV6RoKQdo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ZYbMG5op; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ZYbMG5op" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE094C433F1; Mon, 1 Apr 2024 17:00:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1711990850; bh=/S/ueUQ5XUCPQj2DwYq4QRORsGYNCTVXwy2k7cV5JYE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZYbMG5opDuQEGG2uO8Igx1qmjUcEatGvSqC02H/AMmd/C4OUZZpavq+PQwY1BuN/i sEwaUyVPtYDOkG+i3JAZV55obJGaySIF3Uui5B25v0QlCNEtoR5KytUs54m0sbe5DJ kzphTXnFt1kvN4CizVyyRw+C3V+3/Uhmq56CcHQ8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Gabor Juhos , Stephen Boyd , Bjorn Andersson , Sasha Levin Subject: [PATCH 6.1 056/272] clk: qcom: mmcc-msm8974: fix terminating of frequency table arrays Date: Mon, 1 Apr 2024 17:44:06 +0200 Message-ID: <20240401152532.299881033@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240401152530.237785232@linuxfoundation.org> References: <20240401152530.237785232@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gabor Juhos [ Upstream commit e2c02a85bf53ae86d79b5fccf0a75ac0b78e0c96 ] The frequency table arrays are supposed to be terminated with an empty element. Add such entry to the end of the arrays where it is missing in order to avoid possible out-of-bound access when the table is traversed by functions like qcom_find_freq() or qcom_find_freq_floor(). Only compile tested. Fixes: d8b212014e69 ("clk: qcom: Add support for MSM8974's multimedia clock controller (MMCC)") Signed-off-by: Gabor Juhos Reviewed-by: Stephen Boyd Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20240229-freq-table-terminator-v1-7-074334f0905c@gmail.com Signed-off-by: Bjorn Andersson Signed-off-by: Sasha Levin --- drivers/clk/qcom/mmcc-msm8974.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clk/qcom/mmcc-msm8974.c b/drivers/clk/qcom/mmcc-msm8974.c index 17ed52046170a..eb2b0e2200d23 100644 --- a/drivers/clk/qcom/mmcc-msm8974.c +++ b/drivers/clk/qcom/mmcc-msm8974.c @@ -279,6 +279,7 @@ static struct freq_tbl ftbl_mmss_axi_clk[] = { F(291750000, P_MMPLL1, 4, 0, 0), F(400000000, P_MMPLL0, 2, 0, 0), F(466800000, P_MMPLL1, 2.5, 0, 0), + { } }; static struct clk_rcg2 mmss_axi_clk_src = { @@ -303,6 +304,7 @@ static struct freq_tbl ftbl_ocmemnoc_clk[] = { F(150000000, P_GPLL0, 4, 0, 0), F(291750000, P_MMPLL1, 4, 0, 0), F(400000000, P_MMPLL0, 2, 0, 0), + { } }; static struct clk_rcg2 ocmemnoc_clk_src = { -- 2.43.0