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 DA37CC433EF for ; Thu, 26 May 2022 12:18:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239125AbiEZMSv (ORCPT ); Thu, 26 May 2022 08:18:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234773AbiEZMSt (ORCPT ); Thu, 26 May 2022 08:18:49 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53A82CEBA8; Thu, 26 May 2022 05:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=m2FP5IpgKamAC5k0mppMCSKAd6ddAm9dQQpEqx93+S8=; b=GenS8i0287bKb6Z9UL2JzpKbea RETCRElL4hXbU98Szz3b+ye91a8q4My0r3hozB27fhK+RXJ4FiWJox5aqXeUBg7N4qImYW6uMdJgG lOikZQWFAjsEc0lTgRL3m/SFcFZuhWC+DepM9fmHMVUGnvhVP634lu2e66/bg0VKJgrg=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1nuCRn-004Lll-8e; Thu, 26 May 2022 14:18:35 +0200 Date: Thu, 26 May 2022 14:18:35 +0200 From: Andrew Lunn To: Miaoqian Lin Cc: Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] net: dsa: mv88e6xxx: Fix refcount leak in mv88e6xxx_mdios_register Message-ID: References: <20220526112415.13835-1-linmq006@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220526112415.13835-1-linmq006@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 26, 2022 at 03:24:15PM +0400, Miaoqian Lin wrote: > of_get_child_by_name() returns a node pointer with refcount > incremented, we should use of_node_put() on it when done. > This function missing of_node_put() in an error path. > Add missing of_node_put() to avoid refcount leak. What about releasing the reference on the non error case? Where is that. Andrew