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=1796329688; b=U9PtjxdpqLi1DOvaadjPJUl5ZkHizMJNdQhgn03Xys5oMGgmWscpbMOW63w+X5glh0pe FXwr52bvPpVwYntrs9TsI2oMsh4lhAerl7f2cAIj9n6qD2nVoOIS9UJPO/2cZsJan6u8+ PKRfmygRLIyiucPOhkDzKU4ZZld4m7C+0f1X+D0ln7MaEhT89Qf6L03mfZOKDOG47GEys x3WIT7n3G+arewOUXUgh8ETxE3BAyu9jHxsQX/CzGdMmvI+FKych5oVXw+10/A9O2Mdkg G/XqD757JDP+/xOSg/CyyPIPnpRWSPmhCex4YuyS00x7mdbVYxQGAxRNzxLDVN9tr4A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796329688; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=QIyBP4VhOWPJOsPik3XqDIiz4emAWpz12WeqBw+AG4Q=; b=oq24NqPvSn9swEPKGGbhmkKL2Ek96XLNqyLgaQdYohmoAiVpaAEdG6ATF+5LgZftUEwc wOmPkc8T78idfSPtvvsnISqiHnn9EccDyOIPZXivQ121gcWszZsePP45pnYyQE43gga4H o/JKNX0GGfyEDuUdWAKR2nBQZt6DUod6bbhNi8ejyzEBXDOI3u/HtcZ3wyWpngNxr9rGN TOwShVNwsHtxx5/1MJRME5z7T1Mj1DvLWLC/dP1nZ1N/hNNhObp3ZzzlIEgw/J6Yof0Ed 4LVu2TF1P3Ej9D0cFDIqOptt6u+DAENlIj4b1190sIiJF/Wb8Uio7TWivbOkO3SiJIw== 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=cAtF75ZG; 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 29A3E606A322; Thu, 3 Dec 2026 20:28:07 +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=cAtF75ZG Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9734B1F000CE; Thu, 3 Dec 2026 20:28:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796329687; bh=QIyBP4VhOWPJOsPik3XqDIiz4emAWpz12WeqBw+AG4Q=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=cAtF75ZGUUezLWwdIwttRc8dk3i8RFXqCLlwaewfVGOvjo5/w+e97EHWgOdp/Z92F ++a9oVMcUMv3AvMY0cl/tITp9va21gOZcGMmkEeTAIrTsTQLHVIP0KNJXyv6LQvBjl z4F2zqMSOQHAAFekTyUwRui9idRgrVP9KisnUiujTfRmizxLNM8xfQZAWEmv7ivtjh KawqauggMwm+6gIyUdl2E9e7aGlC+r0AhF8dtYZ4nTGw+hq4poyZWC0WtJEe04F1ZO 45wF22KmwIbc+QWbDkjjpf6nzeqneXI32VmCmP7mA4sC6V/ycFFJ+Eh6JLezS+0uE6 16FG6XZHdPB+Q== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v5 4/4] arm64: dts: qcom: qcs6490-rb3gen2: add TC9564 clock node Reply-To: sashiko-reviews@lists.linux.dev To: "Alex Elder" Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261203200948.1595470-5-elder@riscstar.com> References: <20261203200948.1595470-1-elder@riscstar.com> <20261203200948.1595470-5-elder@riscstar.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 20:28:07 +0000 X-Mailing-List: devicetree@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 3 potential issues to consider: - [High] arm64: dts: qcom: BAR4 translation fails for TC9564 clock-controller@1004 - [Medium] clk: toshiba: devm_reset_register() frees aux_data before auxdev destroy - [Medium] clk: toshiba: devm_reset_register() leaks aux_data on ida_alloc() failure -- commit 179c9f9b50bcdb23af6216cf3aeac69795b3017e Author: Alex Elder arm64: dts: qcom: qcs6490-rb3gen2: add TC9564 clock node This commit adds a fixed 25 MHz crystal clock node and a TC9564 clock and reset controller node under pci-ep-bus@4 in the QCS6490 RB3Gen2 device tree. > diff --git a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts b/arch/arm64/bo= ot/dts/qcom/qcs6490-rb3gen2.dts > index 682bcbc0b466b..87035745b6720 100644 > --- a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts > +++ b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts [ ... ] > @@ -969,6 +976,14 @@ pci-ep-bus@4 { > #size-cells =3D <1>; > /* Map 0x0-0x1fffff to BAR 4 */ > ranges =3D <0x0 0x4 0x0 0x0 0x200000>; > + > + clock-controller@1004 { > + compatible =3D "toshiba,tc9564-clock"; > + reg =3D <0x1004 0x10>; > + clocks =3D <&tc9564_xo_board>; > + #clock-cells =3D <1>; > + #reset-cells =3D <1>; > + }; [Severity: High] Can address translation for clock-controller@1004 succeed with dev@0,0's static placeholder ranges? During PCI enumeration, pci_setup_device() -> pci_set_of_node() binds the static dev@0,0 node to the PCI device. Because pci_device_to_OF_node() is then already non-NULL, the final fixup of_pci_make_dev_node() returns early without updating dev@0,0's ranges property. When tc9564_function_probe() populates the bus, of_address_to_resource() translates reg =3D <0x1004 0x10> via the stale BAR 4 range to 0x85004, outs= ide pcie1's 0x40300000 MEM window in kodiak.dtsi. of_device_alloc() then hits WARN_ON(rc) and tc9564_clk_probe() fails with -EINVAL. [Severity: Medium] In the bound clock driver from commit "clk: toshiba: introduce a TC9564 clock driver", does devm_reset_register() in drivers/clk/clk-tc9564.c free aux_data and the IDA ID while the auxiliary device is still registered? __devm_auxiliary_device_create() registers auxiliary_device_destroy() as a devres action before returning. Registering reset_adev_free() afterwards means LIFO teardown frees aux_data and calls ida_free() before auxiliary_device_destroy() removes the device: CPU0 CPU1 devres_release_all() reset_adev_free() ida_free(&reset_ids, adev->id) kfree(aux_data) tc9564_reset_probe() aux_data =3D dev_get_platdata(dev) aux_data->regs <-- use-after-free auxiliary_device_destroy() Registering cleanup for aux_data and the IDA ID before creating the auxiliary device avoids both the use-after-free and early ID reuse. [Severity: Medium] Also in drivers/clk/clk-tc9564.c:devm_reset_register(), does the ida_alloc() error path leak aux_data? aux_data is allocated with kzalloc_obj() right before ida_alloc(), but an allocation failure returns dev_err_probe() without calling kfree(aux_data). --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203200948.1595= 470-1-elder@riscstar.com?part=3D4