aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/generate_rust_analyzer.py
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2024-09-13 10:00:52 +0200
committerPalmer Dabbelt <palmer@rivosinc.com>2024-10-25 06:18:39 -0700
commit37233169a6ea912020c572f870075a63293b786a (patch)
tree22cc4afa0539eadccd614c2fff2901083cc9ec7d /scripts/generate_rust_analyzer.py
parentriscv: efi: Set NX compat flag in PE/COFF header (diff)
downloadlinux-rng-37233169a6ea912020c572f870075a63293b786a.tar.xz
linux-rng-37233169a6ea912020c572f870075a63293b786a.zip
riscv: Prevent a bad reference count on CPU nodes
When populating cache leaves we previously fetched the CPU device node at the very beginning. But when ACPI is enabled we go through a specific branch which returns early and does not call 'of_node_put' for the node that was acquired. Since we are not using a CPU device node for the ACPI code anyways, we can simply move the initialization of it just passed the ACPI block, and we are guaranteed to have an 'of_node_put' call for the acquired node. This prevents a bad reference count of the CPU device node. Moreover, the previous function did not check for errors when acquiring the device node, so a return -ENOENT has been added for that case. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com> Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> Fixes: 604f32ea6909 ("riscv: cacheinfo: initialize cacheinfo's level and type from ACPI PPTT") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20240913080053.36636-1-mikisabate@gmail.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions