]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
power: reset: linkstation-poweroff: fix use-after-free in the linkstation_poweroff_init()
authorWentao Liang <vulab@iscas.ac.cn>
Tue, 7 Apr 2026 07:30:25 +0000 (07:30 +0000)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Wed, 3 Jun 2026 19:58:00 +0000 (21:58 +0200)
commit8eec545cde69e46e9a1d2b7d915ce4f5df85b3bd
treefbd1f68e1c61473b60e3a8c8204d0a895a445850
parentb26bc0b97d8d1b7454b7f7ab64f1bda8d1cd4002
power: reset: linkstation-poweroff: fix use-after-free in the linkstation_poweroff_init()

Move of_node_put(dn) after the of_match_node() call, which still needs
the node pointer. The node reference is correctly released after use.

Fixes: e2f471efe1d6 ("power: reset: linkstation-poweroff: prepare for new devices")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Link: https://patch.msgid.link/20260407073025.271865-1-vulab@iscas.ac.cn
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/reset/linkstation-poweroff.c