Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3454416imb; Tue, 5 Mar 2019 09:41:39 -0800 (PST) X-Google-Smtp-Source: APXvYqxMODQlHkrxH4gr507PHg3ZHMpo+cXCPn5FS33TrDBFINzcgZH/islye2UAXKAPf2IV7OQV X-Received: by 2002:a17:902:290b:: with SMTP id g11mr2377099plb.269.1551807698935; Tue, 05 Mar 2019 09:41:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551807698; cv=none; d=google.com; s=arc-20160816; b=mRRzYipRI4NvUFLISf2yJfp8PuzRa5SqkrQbIH1LnC+FinQe0n5JRlQD4S5NpWZE5v DVHSWh2BlQ4OxGEnEGnV2G/zNHSJ8p1XKN65syyy9sBucSZ0m4MtMQAR58HK1zp0LseB SKcsCDO8wfvrGF9LhIOOISW9Uz/GH+BarPaBp4cOM2u6aRHQMDHWWRiW9LyuYNt+7hnY 40T49wvgvpouRd/M8az2fCpSuGSM3F4EP43xPfMwTR8RkNaG2dmfhM6ozMYdA8ZQiez7 NPtXJWdcdisae0plYX1mGBS4UZ5Z4+RzJP1PcQF1AW6UqAqJymb2vInA9GBLZ5IZ4JnJ cI4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=4Tw8B+9dl5M+qG13zllqE3uJafdO3lFaK6AkwIiiHLA=; b=Qrn2LyC7EtBMLGZu0mxRTm3Wd7BpPKctG2E6jh2pDz+fs9V82GunkcxnwxqB+R8FeJ RYHAJmsUpdxutUExd9U7bujGnqVqdWefMF/wloGFCUiiBATuA/ROkY7JYY3/zbxoNUp6 1J2QvMLljGNpeTBocAa6wD010frsxRnKfrzS2I99SvKSzYLmeadh797jBsXm05qqrkvu bYqJds3mq9oUTT68LQStJGjo95C4W5UJjC0AaBWbZkAJArcSChoLo9WV/iVOGJdDUCrU XO8FKET5eORO7cD61/GTZBZDDU6SdcQkZmuvtxwk5jzjwbq/+f+4w9HTk/mRyDnWt9o6 QzLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=YCjgZBKX; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c18si4791861plo.405.2019.03.05.09.41.23; Tue, 05 Mar 2019 09:41:38 -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=@broadcom.com header.s=google header.b=YCjgZBKX; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728011AbfCER1O (ORCPT + 99 others); Tue, 5 Mar 2019 12:27:14 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:36370 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727334AbfCER1N (ORCPT ); Tue, 5 Mar 2019 12:27:13 -0500 Received: by mail-pf1-f195.google.com with SMTP id n22so6216739pfa.3 for ; Tue, 05 Mar 2019 09:27:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=4Tw8B+9dl5M+qG13zllqE3uJafdO3lFaK6AkwIiiHLA=; b=YCjgZBKXK8fZt4TGt9pxlRE20txRF4XbadKVLvDfg7bL/+7OatY9gTVQ5YW5fUQq+0 0tVRrT62VNn4968dKncr6pIushx58f/OuliV2o3PiCjUwUhCDSIe8+oa9DMeW29auxwv ChwLRxQkV8tcR5EsrSDOHEjZf6m1k0gTR9ROg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4Tw8B+9dl5M+qG13zllqE3uJafdO3lFaK6AkwIiiHLA=; b=oXvnyY+/zmQqt8Ia9md3LZh74aOj70TvfMj3z0vdKh0lAVb2kYz/HHstEEtQjJMzzJ 3eGprEuI/eN6hCO8yjIRQVCY7SeM3dwMc7YFRgMMpQL77+ZG7GLfOo9HkwdrQyhbDPQM lcBn+ATy14rY7y1IlEU8SJ6yhKRoDZasddFWPCMFqOR8GfAkufhdtXMc9YXQkUFOkRQ3 uQqgpIxmzwjeqGVkwD51zhnuFVhFIfDJ43xlTYe9s3UObJCzYr5s3BdFQrWozgSCqjqI r3/ib828vaFeskX7V0SRS6g/4xNTfv31cXeUNUK9esEpAU0wNZ7x67KKVfxhLD158n4m pWHg== X-Gm-Message-State: APjAAAWLN/cRNdkRO8sna3Ww8KRXH4x8TXHklNjZlPnUWH7HjZfhcYdV GD8RZkSU6+0JSMDw12o7XZfVWA== X-Received: by 2002:a63:d205:: with SMTP id a5mr2372488pgg.142.1551806832665; Tue, 05 Mar 2019 09:27:12 -0800 (PST) Received: from [10.136.8.252] ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id y6sm19786029pfy.87.2019.03.05.09.27.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Mar 2019 09:27:11 -0800 (PST) Subject: Re: [PATCH v2 02/15] ARM: bcm: fix a leaked reference by adding missing of_node_put To: Wen Yang , linux-kernel@vger.kernel.org Cc: wang.yi59@zte.com.cn, Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Russell King , linux-arm-kernel@lists.infradead.org References: <1551785646-46173-1-git-send-email-wen.yang99@zte.com.cn> <1551785646-46173-2-git-send-email-wen.yang99@zte.com.cn> From: Ray Jui Message-ID: <67d1be96-ad8a-a453-996f-731a363677ae@broadcom.com> Date: Tue, 5 Mar 2019 09:24:05 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <1551785646-46173-2-git-send-email-wen.yang99@zte.com.cn> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/5/2019 3:33 AM, 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-bcm/board_bcm281xx.c:43:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 35, but without a corresponding object release within this function. > > Signed-off-by: Wen Yang > Reviewed-by: Florian Fainelli > Cc: Florian Fainelli > Cc: Ray Jui > Cc: Scott Branden > Cc: bcm-kernel-feedback-list@broadcom.com > Cc: Russell King > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > --- > v2->v1: add a missing space between "adding" and "missing" > > arch/arm/mach-bcm/board_bcm281xx.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm/mach-bcm/board_bcm281xx.c b/arch/arm/mach-bcm/board_bcm281xx.c > index b81bb38..1238ac8 100644 > --- a/arch/arm/mach-bcm/board_bcm281xx.c > +++ b/arch/arm/mach-bcm/board_bcm281xx.c > @@ -38,6 +38,7 @@ static void bcm281xx_restart(enum reboot_mode mode, const char *cmd) > return; > } > base = of_iomap(np_wdog, 0); > + of_node_put(np_wdog); > if (!base) { > pr_emerg("Couldn't map brcm,kona-wdt\n"); > return; > Change looks good to me. Thanks! Acked-by: Ray Jui