Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp279027yba; Sat, 13 Apr 2019 00:21:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqwlgarTyB/KYjqglE1cY3VFFhrIioQ1X8SU2aBUhsVa9ULgUvpOd2JNL3+8HIWBGpmhxYNH X-Received: by 2002:a62:cfc4:: with SMTP id b187mr60998497pfg.130.1555140115706; Sat, 13 Apr 2019 00:21:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555140115; cv=none; d=google.com; s=arc-20160816; b=gfa/98++H6L/GRT5mbkb0jj/CXyHUitkXSS4MMVQlPC/aY5l1RJOfCpLRQGGwbHaYU uvV66bBIoSE99vmM7rkL8HTusdr9E4vSrpNSAnBMg9uPZwWoHfjZntealpvlW2ld3gIL kEhnwtWQL46ErbKxSssrtv/7J4Sd6l0zQ0tImfhA4R+oiU6/TsDpL4ihO/wv/IIyZHP3 +S0j3WFar9qYQ00gEzbPubQPBVku1tJlfFYF6N4P4oC53wSiz8CYjjeXIe+4AYYvSzyf eY3B5m5e4pu4Yjs6sEcneEBMlvU96CU31jiikgwSpHZnMbXHKnhlg5ww0RkwpWRXqbiZ 4fiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=24U4JYzFrjGCjf12tGSYEBVl3ZdDmf7y+17bYOq1DR4=; b=fB65psqv/z1Z66CVHZzXxJH/X7wBanG29DqecesmANDAZJwhY6pl9fjwRdGysGL+2d i012ydMmetwdT4pKTGzsnth5rJbn0xr7M+NCqsADSw0Nt6C6d6441u82nkGQyENSnc2S CBPjbgPpaMW+RgsI6mbuJruu8AEyeFyj7FkDJB1oxUuOBYmbd9DTlgj5wzLeytezwTLO oeZp4JxLETz5XSeJdq4e+0y1qcf2Jwf8JJLg0Cd72SuHQ0aG0Eff3dhML6bt2b5+SuhJ +V/ceUqpvDgdhY3kYsQc7SbJaSnTWhP0FfhxUSpGZWtxaWppAEcAFyGk+LvV7iTNSOAV JOwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h187si24988361pgc.287.2019.04.13.00.21.26; Sat, 13 Apr 2019 00:21:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727148AbfDMHU3 (ORCPT + 99 others); Sat, 13 Apr 2019 03:20:29 -0400 Received: from www.osadl.org ([62.245.132.105]:36359 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726285AbfDMHU2 (ORCPT ); Sat, 13 Apr 2019 03:20:28 -0400 Received: from debian01.hofrr.at (178.115.242.59.static.drei.at [178.115.242.59]) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id x3D7JfAQ003435; Sat, 13 Apr 2019 09:19:53 +0200 From: Nicholas Mc Guire To: Russell King Cc: Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Mark Brown , Linus Walleij , Tony Lindgren , Mike Rapoport , Janusz Krzysztofik , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Nicholas Mc Guire Subject: [PATCH] ARM: add missing of_node_put() Date: Sat, 13 Apr 2019 09:14:14 +0200 Message-Id: <1555139666-948-3-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1555139666-948-1-git-send-email-hofrat@osadl.org> References: <1555139666-948-1-git-send-email-hofrat@osadl.org> X-Spam-Status: No, score=-1.9 required=6.0 tests=BAYES_00,DATE_IN_FUTURE_96_Q, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on www.osadl.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The call to of_find_compatible_node() returns a node pointer with refcount incremented thus it must be explicitly decremented here after the last usage. (see drivers/of/base.c:of_find_compatible_node()) Signed-off-by: Nicholas Mc Guire --- Problem located with an experimental coccinelle script Patch was compile tested with: axm55xx_defconfig (with some sparse warnings - not related to the proposed change though) Patch is against 4.17.0 (localversion-next is next-20180614) arch/arm/mach-axxia/platsmp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-axxia/platsmp.c b/arch/arm/mach-axxia/platsmp.c index 502e3df..c706a11 100644 --- a/arch/arm/mach-axxia/platsmp.c +++ b/arch/arm/mach-axxia/platsmp.c @@ -40,10 +40,11 @@ static int axxia_boot_secondary(unsigned int cpu, struct task_struct *idle) syscon_np = of_find_compatible_node(NULL, NULL, "lsi,axxia-syscon"); if (!syscon_np) return -ENOENT; syscon = of_iomap(syscon_np, 0); + of_node_put(syscon_np); if (!syscon) return -ENOMEM; tmp = readl(syscon + SC_RST_CPU_HOLD); writel(0xab, syscon + SC_CRIT_WRITE_KEY); -- 2.1.4