Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4151607imb; Wed, 6 Mar 2019 06:36:33 -0800 (PST) X-Google-Smtp-Source: APXvYqznFKY3uLlyXkwQbMstdbVaPgR8rLxooz/roSUG8iJxvltpLr1ndHYQdYPPX0chK76Qj8GV X-Received: by 2002:a63:cd02:: with SMTP id i2mr6580468pgg.111.1551882993096; Wed, 06 Mar 2019 06:36:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551882993; cv=none; d=google.com; s=arc-20160816; b=kVbmhcNmfrVugyb0RdywDyKNezYE9yjsZaLANRX+ICNRUJemGqpPm8LZ2rgiDEWXXE VWcyrBzqJ4QM9qv1Ucs8I91gc62SFVrdfLW3854iGe+Pc+7LAV1XgGeFkWeyBmBWnEB+ CW8cbzt6U783hNoImnTpnid9mLdy4hOCPjz9JzxX7EWuBkuCD5qYzSEvBj5zTSMkrn1N 6Nav0hvteRxOiUuQm4yfiqTqRjJ7wy6qTvLdPmRbFLdJ/WvZCLQpvYuofxZzPc8ET8TY 4VQwTwp7vApYPywEis9qgah3rIQx+DUNhvtOmQKU6jLBvH/Lm2vhfl2JfM6KcMUwYkm9 oyiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Fzj6yPpBGyW4gOpuAAbL2fwAcOWh2YoVhdgHI+EcGA4=; b=TcBef+Vrxr5ReDsTcaPWSib3mmYaWGTPPprINILEMwmUJeG9drEIIz/OIjWqQuw76/ dwQXLEptLM58uERacvDSIIAuKsm4ZgWYVSxkaFiSrkJWA2rb1K8TxSACGVWAiaoi21q9 2utNdebuKB1nPY2VkPuyJf5eT8AKjsoMRzwtq135fe4c1AU9F+jRGjZX4PQpqaomXJLS 7cobsBv7bNGeeQ3xEiSx1aaN/IEAk9zz6aik5kbO7rjFagv8LqOfBizcmsAvB+Y2Ynu+ 8/BCieR/ZXUKutcIHNWus5cFdCo/9pgM55sBDgujBjTRfhfN0XYi1T+yP9U5CdqulI5Z 7Faw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kCrIszJc; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f14si1693139pln.221.2019.03.06.06.36.17; Wed, 06 Mar 2019 06:36:33 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kCrIszJc; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729731AbfCFMCM (ORCPT + 99 others); Wed, 6 Mar 2019 07:02:12 -0500 Received: from mail-io1-f66.google.com ([209.85.166.66]:39624 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729628AbfCFMCM (ORCPT ); Wed, 6 Mar 2019 07:02:12 -0500 Received: by mail-io1-f66.google.com with SMTP id x3so9966160ior.6 for ; Wed, 06 Mar 2019 04:02:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Fzj6yPpBGyW4gOpuAAbL2fwAcOWh2YoVhdgHI+EcGA4=; b=kCrIszJcTtk+3LdPm4ffSCk2J1dNdecrc0gcscf2vC/UrhS52XUqTEXNgU6I8C1oyB KZHYKLoI6rAGb859yq9Wu05fPEKCfqmKwspKJMQBOMhiE5a29bxuDao3QNc9qiR9Lu0p ao8VNjbTM5lLHOCm9nr5aD1ilZWwo7DQk7r5yZF39zSZIh8coFj7lfCP/ZYvngsBwKYi vs5F6NZlyLDnWQ9c+2z++WjNKYu63TEADoDIyDMLtT33SG2pfvHzsQfmq0lozqvUKQYJ cw2BdR5sp0lwvHpKcHh8cXrulxEDQU7F/Dnz+xXlQ6S2lDzrecB1Ieddme+0LRscNlPW M0mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Fzj6yPpBGyW4gOpuAAbL2fwAcOWh2YoVhdgHI+EcGA4=; b=PHZg2izBVJ+Ywkodg7z9+D0yw/z8++G4prynDF4Tz9sRv/PxJt9QeVCsofms+z/5JX K9oIm1PuQvs8WMg9u8PbPRVd7MUhZoigUhT08MEFvN3KM/NysZnAhuLqOhBQ7LtuRX36 ol0PJs+L1Ifqrn1xVNUekxeT11j6iJyrCT3T2Hxn5CxDNNA1pYhsdscgO2w5gxxfYsKh Ef99MEGSIi6Aqg9XoTIe+i6xuD+Y4mB8jrt8rSDxL4uDdGoQXvB566IodbHJgyNu6QK7 n5dlivBSSXleEI0X6nMt4e/GZv7PuuV8RUpbaONDVVhe3JduAWQx1t8YPbaPYTbxLV9F VLgw== X-Gm-Message-State: APjAAAUHQIYo5E9MQFLo4vpgvCyvHGSIjV0Qvkjrb9eyHaD6yAO+IWa4 rqkEV6q4WUW8Hxy5WqLPFaa/zhgRVyemObxlxFPuMOU= X-Received: by 2002:a6b:691c:: with SMTP id e28mr2748773ioc.295.1551873731203; Wed, 06 Mar 2019 04:02:11 -0800 (PST) MIME-Version: 1.0 References: <1551785646-46173-1-git-send-email-wen.yang99@zte.com.cn> <1551785646-46173-6-git-send-email-wen.yang99@zte.com.cn> In-Reply-To: <1551785646-46173-6-git-send-email-wen.yang99@zte.com.cn> From: Avi Fishman Date: Wed, 6 Mar 2019 14:02:01 +0200 Message-ID: Subject: Re: [PATCH v2 06/15] arm: npcm: fix a leaked reference by adding missing of_node_put To: Wen Yang Cc: Linux Kernel Mailing List , wang.yi59@zte.com.cn, Tomer Maimon , Patrick Venture , Nancy Yuen , Brendan Higgins , Russell King , Linux ARM , OpenBMC Maillist Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 5, 2019 at 1:33 PM Wen Yang wrote: > > The call to of_get_next_child returns a node pointer with refcount > incremented thus it must be explicitly decremented after the last > usage. > > Detected by coccinelle with the following warnings: > ./arch/arm/mach-npcm/platsmp.c:52:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 31, but without a corresponding object release within this function. > ./arch/arm/mach-npcm/platsmp.c:68:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 60, but without a corresponding object release within this function. > > Signed-off-by: Wen Yang > Reviewed-by: Florian Fainelli > Cc: Avi Fishman > Cc: Tomer Maimon > Cc: Patrick Venture > Cc: Nancy Yuen > Cc: Brendan Higgins > Cc: Russell King > Cc: linux-arm-kernel@lists.infradead.org > Cc: openbmc@lists.ozlabs.org > Cc: linux-kernel@vger.kernel.org > --- > v2->v1: add a missing space between "adding" and "missing" > > arch/arm/mach-npcm/platsmp.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/arm/mach-npcm/platsmp.c b/arch/arm/mach-npcm/platsmp.c > index 21633c7..fe63edc 100644 > --- a/arch/arm/mach-npcm/platsmp.c > +++ b/arch/arm/mach-npcm/platsmp.c > @@ -35,6 +35,7 @@ static int npcm7xx_smp_boot_secondary(unsigned int cpu, > goto out; > } > gcr_base = of_iomap(gcr_np, 0); > + of_node_put(gcr_np); > if (!gcr_base) { > pr_err("could not iomap gcr"); > ret = -ENOMEM; > @@ -63,6 +64,7 @@ static void __init npcm7xx_smp_prepare_cpus(unsigned int max_cpus) > return; > } > scu_base = of_iomap(scu_np, 0); > + of_node_put(scu_np); > if (!scu_base) { > pr_err("could not iomap scu"); > return; > -- > 2.9.5 > Reviewed-by: Avi Fishman -- Regards, Avi