]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cpuidle: riscv-sbi: Use scoped device node handling to fix missing of_node_put
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tue, 20 Aug 2024 09:40:22 +0000 (11:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:33:42 +0000 (16:33 +0200)
commitf7cdf73258cfe7f7afc1d0f7195fa10ea61db926
tree1fd32f205e407fe1436589a69d53d52ccca480cb
parentd19c5b21711c4bde4806b0a5aa560f310678ed3d
cpuidle: riscv-sbi: Use scoped device node handling to fix missing of_node_put

commit a309320ddbac6b1583224fcb6bacd424bcf8637f upstream.

Two return statements in sbi_cpuidle_dt_init_states() did not drop the
OF node reference count.  Solve the issue and simplify entire error
handling with scoped/cleanup.h.

Fixes: 6abf32f1d9c5 ("cpuidle: Add RISC-V SBI CPU idle driver")
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://patch.msgid.link/20240820094023.61155-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/cpuidle/cpuidle-riscv-sbi.c