[PW_SID:1091949] [v2] riscv: cacheinfo: Fix node reference leak in populate_cache_leaves#1892
[PW_SID:1091949] [v2] riscv: cacheinfo: Fix node reference leak in populate_cache_leaves#1892linux-riscv-bot wants to merge 2 commits into
Conversation
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 Assisted-by: Gemini:gemini-3.1-pro Signed-off-by: Zishun Yi <vulab@iscas.ac.cn> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v2] riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
|
Patch 1: "[v2] riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
|
Patch 1: "[v2] riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
|
Patch 1: "[v2] riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
|
Patch 1: "[v2] riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
|
Patch 1: "[v2] riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
|
Patch 1: "[v2] riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
|
Patch 1: "[v2] riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
|
Patch 1: "[v2] riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
|
Patch 1: "[v2] riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
|
Patch 1: "[v2] riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
|
Patch 1: "[v2] riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
2d4fcdd to
cd9d421
Compare
PR for series 1091949 applied to workflow__riscv__fixes
Name: [v2] riscv: cacheinfo: Fix node reference leak in populate_cache_leaves
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1091949
Version: 2