From: Wei Yongjun Date: Mon, 17 Oct 2016 16:37:20 +0000 (+0000) Subject: greybus: arche-platform: Add missing of_node_put() in arche_platform_change_state() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=25633d1f5dd7ea35c77aae12c039a80e46abec01;p=linux-beck.git 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: Wei Yongjun Acked-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c index e36ee984485b..34307ac3f255 100644 --- a/drivers/staging/greybus/arche-platform.c +++ b/drivers/staging/greybus/arche-platform.c @@ -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; }