Message ID | 20240229-freq-table-terminator-v1-2-074334f0905c@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-87234-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp584340dyb; Thu, 29 Feb 2024 10:09:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXWJxZdIOvszlH//RUOxP0zYV6281qhA7Zn3dZHFvUzlgTegFiK6qO6uWysxPnXKDohgLjiMfQGlwfK/OeGdWgsz9da9Q== X-Google-Smtp-Source: AGHT+IGKV4KToNs8YtXvG6Gh5mk0jSi48StwCmWOUoXf0a/ac7cxTMrAGmoM+mPLmFlel4J+uSHN X-Received: by 2002:a0c:f94f:0:b0:690:4de5:848a with SMTP id i15-20020a0cf94f000000b006904de5848amr1483142qvo.24.1709230158862; Thu, 29 Feb 2024 10:09:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709230158; cv=pass; d=google.com; s=arc-20160816; b=h/G7XIA9zEAaATjJQ9XY7uFxdMyriSVfw08rPVQUOA5YiMQPW0tFPU4Picb1KW8ZAe k1UiM8NDbxjw5/9TnxTtTrTC3PX5oNCNjHPaqf3pnN6y6TDqCbEGt0NeVigC0PqDqo8A +cuYsRCjGx05H0CTgBnLF0YUvz2bDHI90dk0PCaaRRARFZdwXvfwv7b/m3kM0FI30Ljp dR+AfnZrf/FjUjfQg6jBTwvoloessQWotafrLR5nsF6Ooeu9F3/AZ1618EkvFkA1lrXA O3othnJ2w0NwhnlGPYk212EKs/hp72VDJ8XosFGCgNOH/DL8vk65UO55GQdOeeqHfbeC PzQw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=OYAAhEwR/E+dbtNSsly8JocDfIPA8JdctVrwVBpoHmU=; fh=HJy+LqPkp96+TDN1xq4EQtnq8sxBBOvlT3H8+pk1e+U=; b=wK1mjJsbBcwIIv6+wpCYFtQNUwp/gNroc5cmPdcY+WbU3DW7WmTeow0x6RgceWV7uB BdowimVfLEhsv0PGJ2l4Zlz+PB6lN2Jqa2nVlktVr0JWyW/5QZvcrdu5ZRZM0Ko3qioS S3BiO8U8+dBobmmEsPhhxVZORXkye88WazYaJMzm+4+LWwnDHwLg9U8Ka9S+sCGpAjz0 FuYXkcxPnxQHCawT5MeP+iOz5hAQYX3BOwY4dhH5zypYKcmV6YImPoh8bL50JSqfph8k iWrSaoZQfvO7S6E9A46LSlhNoBSHuBkZNjpMTj7p/MZDKPGonXtcYV8N4gfRF9tlrBL8 usLQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=As62mqys; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87234-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87234-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u2-20020ad45aa2000000b0068fa92d429csi1848997qvg.204.2024.02.29.10.09.18 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 10:09:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87234-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=As62mqys; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87234-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87234-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A541C1C2282D for <ouuuleilei@gmail.com>; Thu, 29 Feb 2024 18:09:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 90684130AC1; Thu, 29 Feb 2024 18:08:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="As62mqys" Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 333197827B; Thu, 29 Feb 2024 18:08:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709230106; cv=none; b=BLOe0EuX/bFndgHnbLsL7IGdVCXssNegkDlyI6BuAxntuZP3FnrIdXN7BIzUJ+glDgu+d+vJ4/76yq4gXXHWl9uFMJvrVMEiBgRENkrprRV5Nb2R7aUP3dbxVpTvl6dPR7E1+Fy2XenajIbaLxg+cFiyIH+VcrtEPV6VXY4i7N4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709230106; c=relaxed/simple; bh=BHpXmfCdFm79sHhjj+p/LhjJdEv9za2/JcqtZAjCXiI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hvl6othtHNF+BOSC+0O22T9tHhxboukMhYsdBVz1NbhhIIW0HcVFBtwhsIAVPxXrEeigZ3o8z/wXDSacJDuui1KtIXx2rH97ZGNYH0pITGek71orXaDit7xH4iVy9TqUExZsmZp64KzCgBpcKiOqJjXEMhSCgnOnxLVHyPoL0iE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=As62mqys; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-412c34e8464so2023155e9.2; Thu, 29 Feb 2024 10:08:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709230103; x=1709834903; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=OYAAhEwR/E+dbtNSsly8JocDfIPA8JdctVrwVBpoHmU=; b=As62mqys29FsIoghvULa8WvplWlStc87rv+dTChhRBeKNST6UZWcMQ1/BxZ0g6NPLs RfVmO+/D8s1y9ke4B2U52Fy24Uek+IYnCWFabHsgFHUq93hS8HiMmtmQ6nvirHSi9oZp GFMnUdH6qPuExTuPHKUivO1cVDGvWFAtDNDXDYSI51OMq0EZE8pVurzTElcl3urtI4A+ 9+vQVbPZ0a7shleWtENBDXCtjEov+OJyWrfljmqXtyVf/3f+/lIUdDLptPvBTKsH9Wrz Z8rnD6YyhjJKsyR4uI72DqsoZ4drmuaZL+ttBRpPpJeJKNdHkkloLrDhK1NPc7iv6Xbz wDuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709230103; x=1709834903; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OYAAhEwR/E+dbtNSsly8JocDfIPA8JdctVrwVBpoHmU=; b=JwbeIMEfx3BxkoPieO4ZycbbRG/wlxFy4znQEuPxk8wih+HkSe4Juu73Ubar5RP4VQ VeaAwFH1vW0PHnYapesVrLMnaHig7UVTjx+SBRSs85/WEOU0oOCCbRogSrNKag1pQMbV oiixaydU/RdaV4qWoVzmlQ9CLnmFed10apNNQEpVYvU/P7j37HBdhCRHMpDXMcl77VJ1 QV2USNZbUhOUiiWu2/kns0J5FSJGf9ApOpvmSV4mKmomXgQBsiUuLsxVVMgURHayuZPw mq4P5HgGLdnMKIaGChb/skCQn+LLb02F9b08GzrHZ+nsiE1DIxzTPbEeH+3kpyI4pWW6 uq7w== X-Forwarded-Encrypted: i=1; AJvYcCWTsjoq6Eank3PVoj7kvB7A3NqYZKiauwIuJHJExmz+fKDkriuzSMq6eAVWVopAwmSRGuzIFCX1GAW3JESAVdJ/DgGcJmLi9Jrlgo0P0uoOtPubFOSDer2OaeVYv2oFewPxlfjygKJC X-Gm-Message-State: AOJu0Yzkret5+XTSw1Dmco2vxj9bVNSjSN2wOZRxnJh4z8jVVkq0war7 +rOjlM8UB6kousTxNohwWg+Wq9m96YV0Re7Qa84IznKiwzPOqBmVGfzTa/VTNuE= X-Received: by 2002:a05:600c:35d2:b0:412:b42c:8ff1 with SMTP id r18-20020a05600c35d200b00412b42c8ff1mr2389897wmq.21.1709230103496; Thu, 29 Feb 2024 10:08:23 -0800 (PST) Received: from [192.168.20.102] (57657817.catv.pool.telekom.hu. [87.101.120.23]) by smtp.googlemail.com with ESMTPSA id z11-20020a1c4c0b000000b00412ba5cda16sm3100620wmf.33.2024.02.29.10.08.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 10:08:23 -0800 (PST) From: Gabor Juhos <j4g8y7@gmail.com> Date: Thu, 29 Feb 2024 19:07:47 +0100 Subject: [PATCH 2/7] clk: qcom: gcc-ipq6018: fix terminating of frequency table arrays Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240229-freq-table-terminator-v1-2-074334f0905c@gmail.com> References: <20240229-freq-table-terminator-v1-0-074334f0905c@gmail.com> In-Reply-To: <20240229-freq-table-terminator-v1-0-074334f0905c@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> X-Mailer: b4 0.12.3 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792257723561386759 X-GMAIL-MSGID: 1792257723561386759 |
Series |
clk: qcom: fix frequency table termination in several drivers
|
|
Commit Message
Gabor Juhos
Feb. 29, 2024, 6:07 p.m. UTC
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: d9db07f088af ("clk: qcom: Add ipq6018 Global Clock Controller support")
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
---
drivers/clk/qcom/gcc-ipq6018.c | 2 ++
1 file changed, 2 insertions(+)
Comments
Quoting Gabor Juhos (2024-02-29 10:07:47) > 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: d9db07f088af ("clk: qcom: Add ipq6018 Global Clock Controller support") > Signed-off-by: Gabor Juhos <j4g8y7@gmail.com> > --- Reviewed-by: Stephen Boyd <sboyd@kernel.org>
diff --git a/drivers/clk/qcom/gcc-ipq6018.c b/drivers/clk/qcom/gcc-ipq6018.c index b366912cd6480..ef1e2ce4804d2 100644 --- a/drivers/clk/qcom/gcc-ipq6018.c +++ b/drivers/clk/qcom/gcc-ipq6018.c @@ -1554,6 +1554,7 @@ static struct clk_regmap_div nss_ubi0_div_clk_src = { static const struct freq_tbl ftbl_pcie_aux_clk_src[] = { F(24000000, P_XO, 1, 0, 0), + { } }; static const struct clk_parent_data gcc_xo_gpll0_core_pi_sleep_clk[] = { @@ -1734,6 +1735,7 @@ static const struct freq_tbl ftbl_sdcc_ice_core_clk_src[] = { F(160000000, P_GPLL0, 5, 0, 0), F(216000000, P_GPLL6, 5, 0, 0), F(308570000, P_GPLL6, 3.5, 0, 0), + { } }; static const struct clk_parent_data gcc_xo_gpll0_gpll6_gpll0_div2[] = {