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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD23DC43334 for ; Tue, 28 Jun 2022 05:52:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245227AbiF1Fwy (ORCPT ); Tue, 28 Jun 2022 01:52:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234982AbiF1Fwx (ORCPT ); Tue, 28 Jun 2022 01:52:53 -0400 Received: from m1550.mail.126.com (m1550.mail.126.com [220.181.15.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 450E82717F; Mon, 27 Jun 2022 22:52:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=Date:From:Subject:MIME-Version:Message-ID; bh=pmUFr 1yYg2L9fvIyy+5KwX7siU5hFTrw80B5JK7OfS8=; b=SwHUeKzEqj+efZ3HY4zxs K9Oiw22rCCUnDsNPcDbaeCz2F9cqfmL4QHSblDQtKf/HswlTUAOSS44Z3wwI3+RY LztbJbac2fMpts0KxoxrZMlcXtn77wLpmT+/fXcd04tpe1ULjgO4RlwQWFjS3wTq +F45RF7WgDI8PpjFFKJuII= Received: from windhl$126.com ( [124.16.139.61] ) by ajax-webmail-wmsvr50 (Coremail) ; Tue, 28 Jun 2022 13:51:50 +0800 (CST) X-Originating-IP: [124.16.139.61] Date: Tue, 28 Jun 2022 13:51:50 +0800 (CST) From: "Liang He" To: "Tony Lindgren" Cc: linux@armlinux.org.uk, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re:Re: [PATCH] arm/mach-omap2: Fix refcount leak bug in omap_hwmod.c X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT5.0.13 build 20220113(9671e152) Copyright (c) 2002-2022 www.mailtech.cn 126com In-Reply-To: References: <20220618014747.4055279-1-windhl@126.com> Content-Transfer-Encoding: base64 Content-Type: text/plain; charset=GBK MIME-Version: 1.0 Message-ID: <4b994fd6.3db9.181a8ddb1e9.Coremail.windhl@126.com> X-Coremail-Locale: zh_CN X-CM-TRANSID: MsqowAAnfPD3lrpiRPI+AA--.18948W X-CM-SenderInfo: hzlqvxbo6rjloofrz/1tbi3BIuF1pED0WRtAADsF X-Coremail-Antispam: 1U5529EdanIXcx71UUUUU7vcSsGvfC2KfnxnUU== Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org CgpBdCAyMDIyLTA2LTI4IDEyOjU3OjEyLCAiVG9ueSBMaW5kZ3JlbiIgPHRvbnlAYXRvbWlkZS5j b20+IHdyb3RlOgo+SGksCj4KPiogTGlhbmcgSGUgPHdpbmRobEAxMjYuY29tPiBbMjIwNjE4IDA0 OjQzXToKPj4gSW4gX2luaXQoKSwgb2ZfZmluZF9ub2RlX2J5X25hbWUoKSB3aWxsIHJldHVybiBh IG5vZGUgcG9pbnRlciB3aXRoCj4+IHJlZmNvdW50IGluY3JlbWVudGVkLiBXZSBzaG91bGQgdXNl IG9mX25vZGVfcHV0KCkgaW4gZmFpbCBwYXRoIG9yCj4+IHdoZW4gaXQgaXMgbm90IHVzZWQgYW55 bW9yZS4KPj4gCj4+IE5PVEU6IEFzIHRoZSByZWYgd2lsbCBiZSBwYXNzZWQgZnJvbSAnYnVzJyB0 byAnbnAnIGJ5IHRoZSB4eF9sb29rdXAoKSwKPj4gaW4gbm9ybWFsIGV4aXQgcGF0aCwgd2Ugc2hv dWxkIGNhbGwgb2Zfbm9kZV9wdXQoKSBhdCB0aGUgZW5kIHVzZSBvZiAnbnAnLAo+PiBub3QgdGhl IGVuZCB1c2Ugb2YgJ2J1cycuCj4KPkxvb2tzIGNvcnJlY3QgdG8gbWUuIFdoYXQgYWJvdXQgbWlz c2luZyBvZl9ub2RlX3B1dCgpIGZvcgo+b2ZfZ2V0X25leHRfY2hpbGQoKSBhbHNvIGluIHRoZSBf aW5pdCgpIGZ1bmN0aW9uPwo+Cj5SZWdhcmRzLAo+Cj5Ub255CgpUaGFua3MsIFRvbnkuCgpJIGhh dmUgZm91bmQgdGhpcyBidWcgYnV0IG5vdCBzZW5kIHRoZSBwYXRjaCBmb3Igb2ZfZ2V0X25leHRf Y2hpbGQoKQphcyBJIGFtIGNvbGxlY3Rpbmcgb3RoZXIgT0YgZnVuY3Rpb24gcmVsYXRlZCBidWdz IGFuZCBJIGhhdmUgYmVlbiB0b2xkIHRoYXQgaXQgaXMgYmV0dGVyIAp0byBjb2xsZWN0IGFsbCBz aW1pbGFyIGJ1Z3MgaW4gc2FtZSBkaXJlY3RvcnksIHRoZW4gZmluYWxseSByZXBvcnQgdGhlbS4K ClNvIEkgd2lsbCBzZW5kIGEgbmV3IHBhdGNoIGZvciBib3RoIG9mIHRoZSB0d28gbWlzc2luZyAn cHV0JyBidWdzIGNhdXNlZCBieQpvZl9maW5kX3h4eCgpIGFuZCBvZl9nZXRfeHh4KCkgaW4gb21h cF9od21vZC5jCgpUaGFua3MgZ2Fpbi4KCkxpYW5nCgo= 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 ADF5AC43334 for ; Tue, 28 Jun 2022 05:57:52 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Message-ID:MIME-Version:References: In-Reply-To:Subject:Cc: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=uJUyGzRE7Al4lldcgAktDqvGJca5lkh0KHUIPcNDHBQ=; b=V3vyUXVWhykEsA wBHGWJg5eUkN6JFKla1wDWc7zLa6YuXNyn/aytIs9vx6TyxPQC46Sul66xBYNGBjgMKB46UtQjAeS heWxAH/85dXRPSGO+okkasi1oWbLQ+UFo5ekwv6fGPhhbhhrMuCQOW7tMsgIAFHLAR0AEMX/61Edb O0ywBsweZadFh/i1qn+wOUlMZTvwanwy4m0qellSs6CmSE3Lxw3ciA5EkwgclG5KTi+ApzE1tXLBQ pT3ZN1/Fp29yZs9jRjiSyKk5I7oa1oNMwcPMWm1gQo8ZWcqdw7ppdjFkD/X8tGDONouT54yu8kPxo 01kjhrf3+kPiv8SgJg0w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o64DH-004Uvs-4A; Tue, 28 Jun 2022 05:56:40 +0000 Received: from m1550.mail.126.com ([220.181.15.50]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o649W-004TFD-RF for linux-arm-kernel@lists.infradead.org; Tue, 28 Jun 2022 05:52:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=Date:From:Subject:MIME-Version:Message-ID; bh=pmUFr 1yYg2L9fvIyy+5KwX7siU5hFTrw80B5JK7OfS8=; b=SwHUeKzEqj+efZ3HY4zxs K9Oiw22rCCUnDsNPcDbaeCz2F9cqfmL4QHSblDQtKf/HswlTUAOSS44Z3wwI3+RY LztbJbac2fMpts0KxoxrZMlcXtn77wLpmT+/fXcd04tpe1ULjgO4RlwQWFjS3wTq +F45RF7WgDI8PpjFFKJuII= Received: from windhl$126.com ( [124.16.139.61] ) by ajax-webmail-wmsvr50 (Coremail) ; Tue, 28 Jun 2022 13:51:50 +0800 (CST) X-Originating-IP: [124.16.139.61] Date: Tue, 28 Jun 2022 13:51:50 +0800 (CST) From: "Liang He" To: "Tony Lindgren" Cc: linux@armlinux.org.uk, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re:Re: [PATCH] arm/mach-omap2: Fix refcount leak bug in omap_hwmod.c X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT5.0.13 build 20220113(9671e152) Copyright (c) 2002-2022 www.mailtech.cn 126com In-Reply-To: References: <20220618014747.4055279-1-windhl@126.com> MIME-Version: 1.0 Message-ID: <4b994fd6.3db9.181a8ddb1e9.Coremail.windhl@126.com> X-Coremail-Locale: zh_CN X-CM-TRANSID: MsqowAAnfPD3lrpiRPI+AA--.18948W X-CM-SenderInfo: hzlqvxbo6rjloofrz/1tbi3BIuF1pED0WRtAADsF X-Coremail-Antispam: 1U5529EdanIXcx71UUUUU7vcSsGvfC2KfnxnUU== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220627_225247_235683_B962156C X-CRM114-Status: UNSURE ( 8.95 ) X-CRM114-Notice: Please train this message. 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: , 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 At 2022-06-28 12:57:12, "Tony Lindgren" wrote: >Hi, > >* Liang He [220618 04:43]: >> In _init(), of_find_node_by_name() will return a node pointer with >> refcount incremented. We should use of_node_put() in fail path or >> when it is not used anymore. >> >> NOTE: As the ref will be passed from 'bus' to 'np' by the xx_lookup(), >> in normal exit path, we should call of_node_put() at the end use of 'np', >> not the end use of 'bus'. > >Looks correct to me. What about missing of_node_put() for >of_get_next_child() also in the _init() function? > >Regards, > >Tony Thanks, Tony. I have found this bug but not send the patch for of_get_next_child() as I am collecting other OF function related bugs and I have been told that it is better to collect all similar bugs in same directory, then finally report them. So I will send a new patch for both of the two missing 'put' bugs caused by of_find_xxx() and of_get_xxx() in omap_hwmod.c Thanks gain. Liang _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel