Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2588793imb; Mon, 4 Mar 2019 08:52:11 -0800 (PST) X-Google-Smtp-Source: APXvYqwAcjBDqepiGA02LmeOu0WI1Ekte3y3VQxAk2lylHyru+BNWRDj4mQ31kpkyfALLFTnCEH+ X-Received: by 2002:a63:cc43:: with SMTP id q3mr19480960pgi.387.1551718330965; Mon, 04 Mar 2019 08:52:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551718330; cv=none; d=google.com; s=arc-20160816; b=rtOuTH35ruw0gwU0aTvs/Y2UXzYfdkKUczQP62aVGRN+/d/Qa4cnhaZ8+GrZZcP7P+ TgEcFJI+D0tOW9xta1WzteUDUoedM6btLK+DI5iiWrBNNhhVBzcS6qmiOe2DdV7Zyabf e3hNCVAHm/4Ct6HJiIisdKWuxw4lfKIfsNcf5nMpQRj8IDF70flUpn/uDngXReZD5vFS 4HYLBupshFupMzS//KrPffqnZo0Y0LlqLbiWk8suBEf5zdHsJBsZLntjZXjxYJI6uH4R Nl8XlGYqHAel3bXJXHWOt+J7GgycckV4C4affaprq+Z71vuYn3nLB6mynto5/SzEjQj4 FbmQ== 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=qE0Zu8808ijdzE0BYmvxkSngUFssgXh8tClUyxa3sPs=; b=v14HbAiW5w6/W+0ufS0NGPr7BmovqrhSv3LwWcZX0WXXDJzKkRPIOmhwFd0+PuI8Cy fj9E0ggP1qqpb2b3orpz0q8xBPxdUM2LvCx9i1nQ5twPM03F91fH4lWwxu55qwaCdqIk QIGfVj4QvNbzZtbWWQWSNkoTsLmNgnS9mfFtRo6tafQB2YUNGQ/ssdLAQ3oEsxGtblBI s7r3jiurH3PLoBU6NoN4eXAI3vOMwjzMr5NZ9jV85iFzyi87m0ot8HumsXaP4R6Jmb+X 3OifW/bNcy8G94Xbg1PYEL/UaHfM80/0LRsFAQ9WFcZxQfLfIMqBzc1w5Sx8ulWmstI/ R4Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XxKfaJGu; 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 v32si5510623pgn.342.2019.03.04.08.51.55; Mon, 04 Mar 2019 08:52:10 -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=XxKfaJGu; 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 S1727103AbfCDPjj (ORCPT + 99 others); Mon, 4 Mar 2019 10:39:39 -0500 Received: from mail-io1-f66.google.com ([209.85.166.66]:43145 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726715AbfCDPjj (ORCPT ); Mon, 4 Mar 2019 10:39:39 -0500 Received: by mail-io1-f66.google.com with SMTP id y6so4262588ioq.10; Mon, 04 Mar 2019 07:39:38 -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=qE0Zu8808ijdzE0BYmvxkSngUFssgXh8tClUyxa3sPs=; b=XxKfaJGuBJFgk/cdzD/2HpobQxzZr57hTbpvfh13vBE5YuF1CzL5NjGfXYEyubSy45 mrZeA//EbvTkN/Dc/l47MzxTn0blpFiRh3HUUek9XzoSZo0oONipY3wgWQJPxf1a3JOc kcyDmj3yESxM27HELfXm3OvSdgldEL+ef/FqFkq9L6LZ7WoPxmHVxRREoWTWkjgJ2aZZ Uy1R4mLYOPh0AV/lS+Y1oL5RuwJHBheMeytrI0eF68IZm9r4/sLVBXMmkbq9h4ljPs2y JpmYdd4rzleV1s3KJpV6MSVDlix4/rP0huFfFs3oqrhe8E0pxWzDpiJ52SPLkWjvzRix w5Tg== 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=qE0Zu8808ijdzE0BYmvxkSngUFssgXh8tClUyxa3sPs=; b=UW6TecJh+U3cY88S4hrMT/+po4WstCrQR+K1WPkQZxj1qmfc7vZRn2nui8pg5JREhh RNvE9WUVBpre+n2NXtFdYeRGiIS7E9XWNowBGzz6pKG1reNN4hLYN9KuLUSq5gVU3Yx/ 08wfVTaSM8lvltFtXYV6GVrtTBj3EiGB4tuYhArilVPExEwPZk2MJ3dqEHhhQLhAYFlP zRSKbUeJqV1CAlRch2zeVsJguztwrkxBuy2A6nqKEsF3K76CE45EU29o6DGYeTtkQ0Kc PiXhcCnLHIvSKHYAcOSCNQwUv2LxJq479l18Gtv0J/gEwhAHYO3yCVPwJURSmdF2pwGp xp1g== X-Gm-Message-State: APjAAAVzGW/Doqf47V0PSm5xRRP697+fA0euenqSaHk3rpvGQhdB4OJ9 YjJ+hL1mw4qarY0I9/d8zgRdbXvcjpBSgI1k7Q== X-Received: by 2002:a6b:6e11:: with SMTP id d17mr9864707ioh.297.1551713977983; Mon, 04 Mar 2019 07:39:37 -0800 (PST) MIME-Version: 1.0 References: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> <1551430616-42014-6-git-send-email-wen.yang99@zte.com.cn> In-Reply-To: <1551430616-42014-6-git-send-email-wen.yang99@zte.com.cn> From: Avi Fishman Date: Mon, 4 Mar 2019 17:39:28 +0200 Message-ID: Subject: Re: [PATCH 06/15] arm: npcm: fix a leaked reference by addingmissing of_node_put To: Wen Yang Cc: liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, Russell King , Linux ARM , Linux Kernel Mailing List , kgene@kernel.org, krzk@kernel.org, linux-samsung-soc@vger.kernel.org, michal.simek@xilinx.com, afaerber@suse.de, manivannan.sadhasivam@linaro.org, dinguyen@kernel.org, heiko@sntech.de, linux-rockchip@lists.infradead.org, Florian Fainelli , rjui@broadcom.com, sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com, linus.walleij@linaro.org, Tomer Maimon , Patrick Venture , Nancy Yuen , Brendan Higgins , OpenBMC Maillist , xuwei5@hisilicon.com, maxime.ripard@bootlin.com, wens@csie.org, catalin.marinas@arm.com, will.deacon@arm.com, horms@verge.net.au, magnus.damm@gmail.com, linux-renesas-soc@vger.kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, fabio.estevam@nxp.com, linux-imx@nxp.com, wang.yi59@zte.com.cn 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 Reviewed-by: Avi Fishman Thanks On Fri, Mar 1, 2019 at 10:57 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-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 > 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 > --- > 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 > -- Regards, Avi