From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796134628; b=gJReBREtnq7n0KRLfew3CitsQnXbDoUvYw/EwgAHHwTRiFKM4ed0MpyDO6XyTmihuHZF WC4/vdcwgA0pkcRwuaNQiNeaTJrTvkJFBQ6I1puPTy/fxBHbrAQKhZ9ctwMhtCdzMbSFW vPn6oKfp3qbqTp6OzrsLGQfrRFrq42JdmNt9aJ492L+xNKQq0xvj7iZVrX4ATyOsESMx1 Bi+ZNtdpSkiD9Ezb2dXkctdt17I6Z3pJ7sDvxtpizbNOtk93TplcSe5tKvEb1etm7aU9S wi/QcjqK/5TrJXpIHEunI3FOrQ5L2gT2+5O+AfsltOXmbO09r6cTpnr+YBblhKqOdMQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796134628; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=qsUt/LXoellLjCpiU3SZjgaHNTXZoulHKooJAAFaFgw=; b=bVAhnaD10iQaIGv7UB2fMjqPbV7XDmk7OAgocuI/nLVk/3ATSyS9pIGHcOSKdM4iRowQ 4Hyyzc02Clgm9NHfxyClLzM+t2GHrMV8NJq+PNbD0ArGj0HgTSCxWFLOxW58OEJ6f/SDp 7+4mpR/HkJOg3i9PewFrNnxSX2FXjRO/R8HKl64ppuIgTNG2BqAZahbg9OvTQHWt6T2rY hHYrgIbsgH6GjZ8MngH3mNWVc4n82sahCRc9T2dkTZ7jG1MdXbuXTi4Bq+C/sQ+s69MYd EBtmsExhfhhZFeKipfcBpV5nX4uVSuNgyMtbmwgwq5gUaS3Fs+wpU6XJlGJqanBK4fQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FW24m87h; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 25099606A331; Tue, 1 Dec 2026 14:17:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FW24m87h Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB7841F00897; Tue, 1 Dec 2026 14:17:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796134628; bh=qsUt/LXoellLjCpiU3SZjgaHNTXZoulHKooJAAFaFgw=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=FW24m87hfYV8qff7UmX7PQiqO/OC6qvVAHeYZLBQc3hA23SpQmXM0KNt12x95waNQ F/E+Ae78gt8PAQsuU0QyeZXflKegXPsZKCBEQQ/5SKIh7TccbK1U/KnLPRKLA83Pxl tI7eNtxVYqC8DvD7+uisvh2h23q+hz0H8MMS0XdJkaHdE2QJxNkRX+25bk+snYEPSY n9hDhZDGdUGNdBxszZxc8tgx5qIqT1ZzkOsOI+bSeTzcGBP61K9lgeHrokHyTK7tca xXV/MiTIYgeiNHyhkhQC9N9pNLuc6g52nCAUQE3P0AxfaaCBc94dfw0HoBgTRc7Bll NNiPswpBq9VJg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v17 8/8] arm64: dts: qcom: Add SM7250 devicetree file Reply-To: sashiko-reviews@lists.linux.dev To: "Sreeshankar K" Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261201-sm7250-v17-8-1477c54422e1@gmail.com> References: <20261201-sm7250-v17-0-1477c54422e1@gmail.com> <20261201-sm7250-v17-8-1477c54422e1@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 14:17:07 +0000 X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] cpufreq: qcom-hw: partial init and resource leak in qcom_cpufreq_hw_cpu_init() -- commit f4a8749fa80adec47ab07b0f3c55f63260609a20 Author: Sreeshankar K arm64: dts: qcom: Add SM7250 devicetree file This commit adds the base SoC devicetree file for Qualcomm SM7250, defining CPUs, caches, PSCI idle states, reserved memory, clocks, interrupt controllers, SPMI, RPMh, cpufreq, and LMh nodes. > diff --git a/arch/arm64/boot/dts/qcom/sm7250.dtsi b/arch/arm64/boot/dts/q= com/sm7250.dtsi > new file mode 100644 > index 0000000000000..a47143c091bb0 > --- /dev/null > +++ b/arch/arm64/boot/dts/qcom/sm7250.dtsi [ ... ] > + cpufreq_hw: cpufreq@18323000 { > + compatible =3D "qcom,sm7250-cpufreq-hw", "qcom,cpufreq-hw"; > + reg =3D <0 0x18323000 0 0x1000>, > + <0 0x18325800 0 0x1000>, > + <0 0x18327800 0 0x1000>; > + reg-names =3D "freq-domain0", > + "freq-domain1", > + "freq-domain2"; > + interrupts-extended =3D <&lmh_cluster0 0>, > + <&lmh_cluster1 0>; > + interrupt-names =3D "dcvsh-irq-0", > + "dcvsh-irq-1"; > + clocks =3D <&rpmhcc RPMH_CXO_CLK>, <&gcc GPLL0>; > + clock-names =3D "xo", "alternate"; > + #freq-domain-cells =3D <1>; > + #clock-cells =3D <1>; > + }; [Severity: Medium] Can defining three frequency domains with only two LMh interrupts here cause partial cpufreq registration, leaked frequency tables and a use-after-free of data->policy if the LMh irqdomains are unavailable when qcom-cpufreq-hw probes (for example when CONFIG_QCOM_LMH=3Dn)? In qcom_cpufreq_hw_cpu_init(), data->policy is assigned and qcom_cpufreq_hw_read_lut() allocates policy->freq_table and adds dynamic OPPs before calling qcom_cpufreq_hw_lmh_init(): drivers/cpufreq/qcom-cpufreq-hw.c:qcom_cpufreq_hw_cpu_init() { ... data->policy =3D policy; ret =3D qcom_cpufreq_hw_read_lut(cpu_dev, policy); ... return qcom_cpufreq_hw_lmh_init(policy, index); } When lmh_cluster0 and lmh_cluster1 have not registered their irqdomains, platform_get_irq_optional(pdev, index) returns -EPROBE_DEFER for domains 0 and 1 (CPUs 0..6), whereas domain 2 (CPU 7) has no entry in interrupts-extended and gets -ENXIO, which qcom_cpufreq_hw_lmh_init() treats as success. Because CPU 7 succeeds, cpufreq_register_driver() sees a non-empty policy list and returns 0 instead of deferring the driver probe. For CPUs 0..6, cpufreq_policy_online() aborts without calling cpufreq_driver->exit() and cpufreq_online() frees the failed cpufreq_policy structs. This leaves CPUs 0..6 without cpufreq support, leaks their policy->freq_table and OPPs, and leaves data->policy for domains 0 and 1 pointing to freed memory that qcom_cpufreq_hw_recalc_rate() dereferences when the registered domain clocks are queried. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201-sm7250-v17= -0-1477c54422e1@gmail.com?part=3D8