Skip to content

[PW_SID:1070875] riscv: cacheinfo: Fix node reference leak in populate_cache_leaves#1660

Closed
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1070875
Closed

[PW_SID:1070875] riscv: cacheinfo: Fix node reference leak in populate_cache_leaves#1660
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1070875

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 1070875 applied to workflow__riscv__fixes

Name: riscv: cacheinfo: Fix node reference leak in populate_cache_leaves
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1070875
Version: 1

Currently, the while loop drops the reference to prev in each iteration.
If the loop terminates early due to a break, the final of_node_put(np)
correctly drops the reference to the current node.

However, if the loop terminates naturally because np == NULL, calling
of_node_put(np) is a no-op. This leaves the last valid node stored in
prev without its reference dropped, resulting in a node reference leak.

Fix this by changing the final `of_node_put(np)` to `of_node_put(prev)`.

Fixes: 94f9bf1 ("RISC-V: Fix of_node_* refcount")
Cc: stable@vger.kernel.org
Signed-off-by: Zishun Yi <vulab@iscas.ac.cn>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 138.18 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1102.63 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1611.81 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.67 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 27.65 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.75 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 84.63 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.21 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves"
kdoc
Desc: Detects for kdoc errors
Duration: 0.86 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves"
module-param
Desc: Detect module_param changes
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.29 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot deleted the pw1070875 branch March 23, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants