From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6932FC43334 for ; Mon, 6 Jun 2022 09:26:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iuSigZaI0byitBzN2dDDoStTRvUSuyy8r3nWNF+rY9c=; b=eXUJ868iDtt6Fr J+qILXPXnf9KXRf3LZidcbxvgjSg4D2/vvdbBA4SZSp+nd98AUZlTGsePAm9zsDMg4DIjFgqb7i5a LZ0n77kitSh2pS4s3DlTfdsFpPM910c4QIYQ3yBAWyjUh1trUJTU6z84ZJjkOI/Cgjlej+viHUT4X IW8dBON86jSJlISiI2A91Rh2lttcIbQwR4IR+X1cUtz5jkGUkIC4i1vf1N+T+CZA9C826JI5FqV+b DrdUlak0gYI5Rp29JqOiRjOJ1hJXMh7dpfCB/7eH+OEmcQyCHMdKQjC+16Qdsd9FH2pjiaEfEXQaw OEEcoYeMShb3N3wru/Dg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ny8zZ-000ORj-VK; Mon, 06 Jun 2022 09:25:46 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ny8x6-000NEM-JY for linux-arm-kernel@lists.infradead.org; Mon, 06 Jun 2022 09:23:14 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8FF4011FB; Mon, 6 Jun 2022 02:23:06 -0700 (PDT) Received: from bogus (unknown [10.57.9.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A57AE3F66F; Mon, 6 Jun 2022 02:23:04 -0700 (PDT) Date: Mon, 6 Jun 2022 10:22:16 +0100 From: Sudeep Holla To: Claudiu.Beznea@microchip.com Subject: Re: [PATCH] drivers: soc: atmel: Fix refcount leak in atmel_soc_device_init Message-ID: <20220606092216.5s54nzplpsiyj3bv@bogus> References: <20220605084035.27127-1-linmq006@gmail.com> <48c19453-984b-c3ae-b62b-2f0455330084@microchip.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <48c19453-984b-c3ae-b62b-2f0455330084@microchip.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220606_022312_740584_E10F9EF2 X-CRM114-Status: GOOD ( 18.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linmq006@gmail.com, alexandre.belloni@bootlin.com, linux-kernel@vger.kernel.org, Mihai.Sain@microchip.com, Sudeep Holla , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jun 06, 2022 at 09:00:52AM +0000, Claudiu.Beznea@microchip.com wrote: > On 05.06.2022 11:40, Miaoqian Lin wrote: > > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe > > > > of_find_node_by_path() returns a node pointer with refcount incremented, > > we should use of_node_put() on it when not need anymore. > > Add missing of_node_put() to avoid refcount leak. > > > > Fixes: 960ddf70cc11 ("drivers: soc: atmel: Avoid calling at91_soc_init on non AT91 SoCs") > > Signed-off-by: Miaoqian Lin > > --- > > drivers/soc/atmel/soc.c | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/soc/atmel/soc.c b/drivers/soc/atmel/soc.c > > index b2d365ae0282..46dfa24c52fb 100644 > > --- a/drivers/soc/atmel/soc.c > > +++ b/drivers/soc/atmel/soc.c > > @@ -369,10 +369,13 @@ static int __init atmel_soc_device_init(void) > > { > > struct device_node *np = of_find_node_by_path("/"); > > > > What about having it like this: > const struct of_device_id *of_id; > > of_id = of_match_node(at91_soc_allowed_list, np); > of_node_put(np); +1, I was about to make similar suggestion in couple of other patches making similar changes. -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel