mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
power: reset: linkstation-poweroff: fix use-after-free in the linkstation_poweroff_init()
commit8eec545cdeupstream. 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:e2f471efe1("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
720949ed66
commit
2205275be9
@@ -163,10 +163,10 @@ static int __init linkstation_poweroff_init(void)
|
||||
dn = of_find_matching_node(NULL, ls_poweroff_of_match);
|
||||
if (!dn)
|
||||
return -ENODEV;
|
||||
of_node_put(dn);
|
||||
|
||||
match = of_match_node(ls_poweroff_of_match, dn);
|
||||
cfg = match->data;
|
||||
of_node_put(dn);
|
||||
|
||||
dn = of_find_node_by_name(NULL, cfg->mdio_node_name);
|
||||
if (!dn)
|
||||
|
||||
Reference in New Issue
Block a user