Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935881AbcJQQhf (ORCPT ); Mon, 17 Oct 2016 12:37:35 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:34616 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755100AbcJQQh2 (ORCPT ); Mon, 17 Oct 2016 12:37:28 -0400 From: Wei Yongjun To: Vaibhav Hiremath , Johan Hovold , Alex Elder , Greg Kroah-Hartman Cc: Wei Yongjun , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH -next] greybus: arche-platform: Add missing of_node_put() in arche_platform_change_state() Date: Mon, 17 Oct 2016 16:37:20 +0000 Message-Id: <1476722240-23063-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 837 Lines: 27 From: Wei Yongjun 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 --- drivers/staging/greybus/arche-platform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c index a850f6b..389ed36 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; }