Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 25633d1f authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman
Browse files

greybus: arche-platform: Add missing of_node_put() in arche_platform_change_state()



This node pointer is returned by of_find_compatible_node() with
refcount incremented in this function. of_node_put() on it before
exitting this function.

This is detected by Coccinelle semantic patch.

Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Acked-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cf55902b
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -128,6 +128,7 @@ int arche_platform_change_state(enum arche_platform_state state,
	pdev = of_find_device_by_node(np);
	pdev = of_find_device_by_node(np);
	if (!pdev) {
	if (!pdev) {
		pr_err("arche-platform device not found\n");
		pr_err("arche-platform device not found\n");
		of_node_put(np);
		return -ENODEV;
		return -ENODEV;
	}
	}