[PW_SID:1070875] riscv: cacheinfo: Fix node reference leak in populate_cache_leaves#1660
[PW_SID:1070875] riscv: cacheinfo: Fix node reference leak in populate_cache_leaves#1660linux-riscv-bot wants to merge 1 commit 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 Signed-off-by: Zishun Yi <vulab@iscas.ac.cn> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
|
Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
|
Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
|
Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
|
Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
|
Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
|
Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
|
Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
|
Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
|
Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
|
Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
|
Patch 1: "riscv: cacheinfo: Fix node reference leak in populate_cache_leaves" |
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