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 8CAEB4D583; Mon, 1 Apr 2024 15:52:34 +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=1711986754; cv=none; b=KfD4L9y5xfkaLQe8n7arVQ44Norw8CtNOFIbfJKtTQA+4cv2LeUOGUnC1IWUnP4ArW9+qz655/CM+gHZ0yNDCwJNlGzJriYng33dYEcsEwRRlWfW80uQs0zlr85dV8bauiw07RV6mUi21MIu6LoPIN9RgIGvF7coT9N9A5hLCiU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711986754; c=relaxed/simple; bh=MdT3ON7b9XDcM5yu8GIaJp+6WC205ZfGJ3ZpMblC97A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nqmZSfPLFDwqgEde/j8GZs574XThIu7F7zBqWe1MdQ9Zsq+Mozkel0EcP5Con0y0KSL9L2EhZknQmLvVd4Jruyf/4SC99NhYuLg3Xlp+rJD61f0nEJoMMXcFTQASvzqxPlxMbOv9w50CbjBQJhlm4SvWTnPFGovlPjSYcAf7HUA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Bp+zoTmy; 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="Bp+zoTmy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F4EBC433F1; Mon, 1 Apr 2024 15:52:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1711986754; bh=MdT3ON7b9XDcM5yu8GIaJp+6WC205ZfGJ3ZpMblC97A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bp+zoTmyhcObWf6RmYo9joi32C/jxXVvNibnDhggb7UvVascr0utv4MVBHS+cqP8M O4rKApv2GLRGk6+frmTxXqMLcndrKWnwQP6MOoYQ3LHfY/ONQOxVNRhNG5wfWSlmx1 mNU/ckV1iOpbnWDcAlyX9KM+N9TfOSyiaXzDugsY= 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.8 075/399] clk: qcom: mmcc-apq8084: fix terminating of frequency table arrays Date: Mon, 1 Apr 2024 17:40:41 +0200 Message-ID: <20240401152551.421721413@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240401152549.131030308@linuxfoundation.org> References: <20240401152549.131030308@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.8-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gabor Juhos [ Upstream commit a903cfd38d8dee7e754fb89fd1bebed99e28003d ] 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: 2b46cd23a5a2 ("clk: qcom: Add APQ8084 Multimedia Clock Controller (MMCC) support") 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-6-074334f0905c@gmail.com Signed-off-by: Bjorn Andersson Signed-off-by: Sasha Levin --- drivers/clk/qcom/mmcc-apq8084.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clk/qcom/mmcc-apq8084.c b/drivers/clk/qcom/mmcc-apq8084.c index 02fc21208dd14..c89700ab93f9c 100644 --- a/drivers/clk/qcom/mmcc-apq8084.c +++ b/drivers/clk/qcom/mmcc-apq8084.c @@ -348,6 +348,7 @@ static struct freq_tbl ftbl_mmss_axi_clk[] = { F(333430000, P_MMPLL1, 3.5, 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 = { @@ -372,6 +373,7 @@ static struct freq_tbl ftbl_ocmemnoc_clk[] = { F(150000000, P_GPLL0, 4, 0, 0), F(228570000, P_MMPLL0, 3.5, 0, 0), F(320000000, P_MMPLL0, 2.5, 0, 0), + { } }; static struct clk_rcg2 ocmemnoc_clk_src = { -- 2.43.0