All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gabor Juhos <j4g8y7@gmail.com>
To: Bjorn Andersson <andersson@kernel.org>,
	 Konrad Dybcio <konrad.dybcio@linaro.org>,
	 Michael Turquette <mturquette@baylibre.com>,
	 Stephen Boyd <sboyd@kernel.org>,
	 Sricharan Ramabadhran <quic_srichara@quicinc.com>,
	 Varadarajan Narayanan <quic_varada@quicinc.com>,
	 Gokul Sriram Palanisamy <quic_gokulsri@quicinc.com>,
	 Devi Priya <quic_devipriy@quicinc.com>,
	 Anusha Rao <quic_anusha@quicinc.com>,
	 Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
	 Georgi Djakov <gdjakov@mm-sol.com>
Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
	 linux-kernel@vger.kernel.org, Gabor Juhos <j4g8y7@gmail.com>
Subject: [PATCH 1/7] clk: qcom: gcc-ipq5018: fix terminating of frequency table arrays
Date: Thu, 29 Feb 2024 19:07:46 +0100	[thread overview]
Message-ID: <20240229-freq-table-terminator-v1-1-074334f0905c@gmail.com> (raw)
In-Reply-To: <20240229-freq-table-terminator-v1-0-074334f0905c@gmail.com>

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().

Fixes: e3fdbef1bab8 ("clk: qcom: Add Global Clock controller (GCC) driver for IPQ5018")
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
---
 drivers/clk/qcom/gcc-ipq5018.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/clk/qcom/gcc-ipq5018.c b/drivers/clk/qcom/gcc-ipq5018.c
index 4aba47e8700d2..856a2b30e2a8e 100644
--- a/drivers/clk/qcom/gcc-ipq5018.c
+++ b/drivers/clk/qcom/gcc-ipq5018.c
@@ -857,6 +857,7 @@ static struct clk_rcg2 lpass_sway_clk_src = {
 
 static const struct freq_tbl ftbl_pcie0_aux_clk_src[] = {
 	F(2000000, P_XO, 12, 0, 0),
+	{ }
 };
 
 static struct clk_rcg2 pcie0_aux_clk_src = {
@@ -1099,6 +1100,7 @@ static const struct freq_tbl ftbl_qpic_io_macro_clk_src[] = {
 	F(100000000, P_GPLL0, 8, 0, 0),
 	F(200000000, P_GPLL0, 4, 0, 0),
 	F(320000000, P_GPLL0, 2.5, 0, 0),
+	{ }
 };
 
 static struct clk_rcg2 qpic_io_macro_clk_src = {
@@ -1194,6 +1196,7 @@ static struct clk_rcg2 ubi0_axi_clk_src = {
 static const struct freq_tbl ftbl_ubi0_core_clk_src[] = {
 	F(850000000, P_UBI32_PLL, 1, 0, 0),
 	F(1000000000, P_UBI32_PLL, 1, 0, 0),
+	{ }
 };
 
 static struct clk_rcg2 ubi0_core_clk_src = {

-- 
2.44.0


  reply	other threads:[~2024-02-29 18:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29 18:07 [PATCH 0/7] clk: qcom: fix frequency table termination in several drivers Gabor Juhos
2024-02-29 18:07 ` Gabor Juhos [this message]
2024-03-01  1:16   ` [PATCH 1/7] clk: qcom: gcc-ipq5018: fix terminating of frequency table arrays Stephen Boyd
2024-03-01  9:40   ` Johan Hovold
2024-03-01 13:37     ` Gabor Juhos
2024-03-01 14:03       ` Johan Hovold
2024-03-02 18:41         ` Bjorn Andersson
2024-02-29 18:07 ` [PATCH 2/7] clk: qcom: gcc-ipq6018: " Gabor Juhos
2024-03-01  1:17   ` Stephen Boyd
2024-02-29 18:07 ` [PATCH 3/7] clk: qcom: gcc-ipq8074: " Gabor Juhos
2024-03-01  1:18   ` Stephen Boyd
2024-02-29 18:07 ` [PATCH 4/7] clk: qcom: gcc-ipq9574: " Gabor Juhos
2024-03-01  1:18   ` Stephen Boyd
2024-02-29 18:07 ` [PATCH 5/7] clk: qcom: camcc-sc8280xp: " Gabor Juhos
2024-03-01  1:19   ` Stephen Boyd
2024-02-29 18:07 ` [PATCH 6/7] clk: qcom: mmcc-apq8084: " Gabor Juhos
2024-03-01  1:19   ` Stephen Boyd
2024-02-29 18:07 ` [PATCH 7/7] clk: qcom: mmcc-msm8974: " Gabor Juhos
2024-03-01  1:20   ` Stephen Boyd
2024-03-03 19:50 ` [PATCH 0/7] clk: qcom: fix frequency table termination in several drivers Bjorn Andersson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240229-freq-table-terminator-v1-1-074334f0905c@gmail.com \
    --to=j4g8y7@gmail.com \
    --cc=andersson@kernel.org \
    --cc=bryan.odonoghue@linaro.org \
    --cc=gdjakov@mm-sol.com \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=quic_anusha@quicinc.com \
    --cc=quic_devipriy@quicinc.com \
    --cc=quic_gokulsri@quicinc.com \
    --cc=quic_srichara@quicinc.com \
    --cc=quic_varada@quicinc.com \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.