Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5863027imb; Fri, 8 Mar 2019 04:10:08 -0800 (PST) X-Google-Smtp-Source: APXvYqwcJqH4gdCYzLXy2h7kR53wUV+oWD9aNzbVJjA4v/w3KoddnhuygssNCmtKYAxJGG9FVbVz X-Received: by 2002:a63:5b64:: with SMTP id l36mr426525pgm.182.1552047008298; Fri, 08 Mar 2019 04:10:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552047008; cv=none; d=google.com; s=arc-20160816; b=MsIk5KQLXAqot0REnA3HXbcRhh9C96/citbpaQL3VZuOX57S95HAuZsWVxZxmxdu8l PKwCTeYEG+rQtK6b2n+S2AFnBBDmpNYNqsGQysRYqr0fe0H37kMFrRqo8550AwGdALf/ ymkrTrgTwnCBgS+y9bwFK9mmyRiImtBtLLdS+BKH5YpiLlukL/zzID1Ip8csCd4sV+o0 nB/r8+n9d6OljEZt4MISqlEjqi3DAvbSfwpBl8KO6ueeKHSyHtZnCH7RiqjvT5WhrSDl q6Ei87Y1rB12hiVuie+z2XmdxWM69Ikhfq2jrSmEN8OlUd1I3vciNpvQ7mnGYle0SrYl hWog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organisation:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=p0v3mH2gCRohIZTFxGoQ0VS5zbno97rHq/aHRX+roLQ=; b=nx+Cp0lsJyCxiaguX7hac4q4t3U3Nqxatbg0D2ifL+HDOsUgulu2vZznlJN7Xt9fp5 arS2V5Z7SOQqQ+l/a5B4e65d8IfiOZF1zg8PE6oM54lwGVJ65YlumsQdf/AYwlHY2+eJ lVMRNs8zNGGFLBDZcUJK/KoIvWjZGpONrsrkF0ffX0wG5sOECxM+sIsoT1Gf+E/ngpe+ 5XA7WDeCTzf9QBMVd8fN5f8qDVJGxtp/Kcrhj/RO7sD1cFUmYlxlGytOy0b3Xc5HJiiO 2lBk62MG6gvk4QEN9H5Un4Yz18SR9B5hgfOrq/dyfDOCX5H4uak3CD4H7eU/HEQG12hR UePg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@verge.net.au header.s=mail header.b=FkGFioHe; 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 cb3si7112060plb.254.2019.03.08.04.09.52; Fri, 08 Mar 2019 04:10:08 -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=fail header.i=@verge.net.au header.s=mail header.b=FkGFioHe; 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 S1726613AbfCHMHt (ORCPT + 99 others); Fri, 8 Mar 2019 07:07:49 -0500 Received: from kirsty.vergenet.net ([202.4.237.240]:47518 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726357AbfCHMHs (ORCPT ); Fri, 8 Mar 2019 07:07:48 -0500 Received: from reginn.horms.nl (watermunt.horms.nl [80.127.179.77]) by kirsty.vergenet.net (Postfix) with ESMTPA id 995E325BEE4; Fri, 8 Mar 2019 23:07:45 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=verge.net.au; s=mail; t=1552046865; bh=do/NZoA+2yVYjcKfNWQJCtxHXOG03DljP4xUfjCII/U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FkGFioHexwEdup88xYIeCzYwsbOEcsrMm9vi35HG9cVMuk1l8V+T7TmKiomlTyXyt PjxOwCdTmjws4P/oVp5k1VdkGMTIlRp5RbVkF/uMPHMbem2qG/1S18JjbYA1KPEzsK Vtv+02nmwb5EimknsMKt1NI+jxm8RLtbTy30qnsk= Received: by reginn.horms.nl (Postfix, from userid 7100) id 0A298940270; Fri, 8 Mar 2019 13:07:43 +0100 (CET) Date: Fri, 8 Mar 2019 13:07:43 +0100 From: Simon Horman To: Wen Yang Cc: linux-kernel@vger.kernel.org, wang.yi59@zte.com.cn, Magnus Damm , Russell King , linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 08/15] ARM: shmobile: fix a leaked reference by adding missing of_node_put Message-ID: <20190308120743.bsqma3pp6h52bd53@verge.net.au> References: <1551785646-46173-1-git-send-email-wen.yang99@zte.com.cn> <1551785646-46173-8-git-send-email-wen.yang99@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1551785646-46173-8-git-send-email-wen.yang99@zte.com.cn> Organisation: Horms Solutions BV User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 05, 2019 at 07:33:59PM +0800, 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-shmobile/pm-rcar-gen2.c:77:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 66, but without a corresponding object release within this function. > ./arch/arm/mach-shmobile/pm-rcar-gen2.c:85:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 66, but without a corresponding object release within this function. > ./arch/arm/mach-shmobile/pm-rcar-gen2.c:90:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 66, but without a corresponding object release within this function. > > Signed-off-by: Wen Yang > Reviewed-by: Florian Fainelli > Reviewed-by: Geert Uytterhoeven > Cc: Simon Horman > Cc: Magnus Damm > Cc: Russell King > Cc: linux-renesas-soc@vger.kernel.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > --- > v2->v1: add a missing space between "adding" and "missing" Thanks, I have this applied for inclusion in v5.2. > arch/arm/mach-shmobile/pm-rcar-gen2.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm/mach-shmobile/pm-rcar-gen2.c b/arch/arm/mach-shmobile/pm-rcar-gen2.c > index 8c2a205..e84599d 100644 > --- a/arch/arm/mach-shmobile/pm-rcar-gen2.c > +++ b/arch/arm/mach-shmobile/pm-rcar-gen2.c > @@ -72,6 +72,7 @@ void __init rcar_gen2_pm_init(void) > } > > error = of_address_to_resource(np, 0, &res); > + of_node_put(np); > if (error) { > pr_err("Failed to get smp-sram address: %d\n", error); > return; > -- > 2.9.5 >