Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3659233iog; Mon, 27 Jun 2022 23:13:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sxtPKZQz7SofVPzxUXoH3ye8lSMU0mx7/5/w6dSHyLZ5QPlgNyO1PD/cuURWBpX6kL33cg X-Received: by 2002:a17:902:ed02:b0:169:e40a:7bed with SMTP id b2-20020a170902ed0200b00169e40a7bedmr3243582pld.167.1656396828822; Mon, 27 Jun 2022 23:13:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656396828; cv=none; d=google.com; s=arc-20160816; b=lYXMvcA37VHRJ4KY7wNhIKDQX7/iaJmpDz+y07Zo2YqdM88I/Nqw0FCxR708xy4bLJ +JqJPbRnuCxUM9doq2JqtxuUm4fNS8njHFv7XdWjhnU9pqnAVJI2Qcj8SxO//Ve2tIq6 byqmdXPvUE9RyWrhNypqx6jr3mbyG5wsbeZGCO+bgWv/b5ZbTH0NjOishmheyLLEyIuF 6yALt8DVRcnhPmHD1bDJNP1DORyeudX9aDcPO5FpB12Xk+TbcMu3V6meXuipyd2yFtu7 EJ3A7cYq/nLucJzS/kzH6bTEX9RFVa7djJFWreHscQeA0QKK9WNaaoUK5V5X3yxwEy28 Ug7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=ZpEgCyWCZ2kVS0zi0A+dyLs8cvCuL5AasYePgsVyM/Y=; b=yUTlnTk6GlvJyphi6Hbx3o3gFTbtvEi3djfOilq3inLPBGLazIwzeXJVhOiUz4Lz2G hupiPEHfL214d8RW3z7J/lEWmgp3EIs6VhfrXR4ydUMNmsM/4i5Q+W2tVyEvzIFyxqss Ld7sywkujc6kKxDP0l7vrdIh6DRYjxyCeEVciox50FDaV9GHuqGrefa+mcK9/mNVbcFj hUYRIPnKODz2vimTtoWxmwP73DkcKnGD2NdinuN8qkRiXmp2iGtVxoZ8w1Mr5dNuiGLR wzGD1h6zSdw/q3MOeMR3vE/5rxdSdXvMCnUS9jzak6uJ/vp/pYmnodCFxYHpwDECwwzg 5i3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u1-20020a632341000000b003fdc8b4d872si17499915pgm.602.2022.06.27.23.13.36; Mon, 27 Jun 2022 23:13:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245208AbiF1GEx (ORCPT + 99 others); Tue, 28 Jun 2022 02:04:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbiF1GEw (ORCPT ); Tue, 28 Jun 2022 02:04:52 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5691B2315F; Mon, 27 Jun 2022 23:04:51 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id D354681BC; Tue, 28 Jun 2022 05:59:38 +0000 (UTC) Date: Tue, 28 Jun 2022 09:04:49 +0300 From: Tony Lindgren To: Liang He 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 Message-ID: References: <20220618014747.4055279-1-windhl@126.com> <4b994fd6.3db9.181a8ddb1e9.Coremail.windhl@126.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4b994fd6.3db9.181a8ddb1e9.Coremail.windhl@126.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Liang He [220628 05:47]: > > > 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. Well in this case while you review a single function, it's usually better to fix similar issues to avoid having to review the same function multiple times. Of course if the patch becomes hard to read, then it makes sense to split it into several patches. > 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 Please just update this patch so we have _init() completely reviewed for similar issues and is not left only partially patched. Regards, Tony