Skip to content

Commit

Permalink
greybus: arche-platform: Add missing of_node_put() in arche_platform_…
Browse files Browse the repository at this point in the history
…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: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Wei Yongjun authored and Greg Kroah-Hartman committed Oct 24, 2016
1 parent cf55902 commit 25633d1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/staging/greybus/arche-platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ int arche_platform_change_state(enum arche_platform_state state,
pdev = of_find_device_by_node(np);
if (!pdev) {
pr_err("arche-platform device not found\n");
of_node_put(np);
return -ENODEV;
}

Expand Down

0 comments on commit 25633d1

Please sign in to comment.