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 11740C6FA82 for ; Wed, 21 Sep 2022 00:45:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231299AbiIUApf (ORCPT ); Tue, 20 Sep 2022 20:45:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231431AbiIUApd (ORCPT ); Tue, 20 Sep 2022 20:45:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 350E578218 for ; Tue, 20 Sep 2022 17:45:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C95CF6277F for ; Wed, 21 Sep 2022 00:45:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC7CFC433D6; Wed, 21 Sep 2022 00:45:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663721131; bh=Rp/6BV4OTlUBOKn+nJOgSI1ZrFQQHbOZ4nh8dT1NJS4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=XTp3Vbgy2l/Q0kSiUVgynuq7Epy6QNsrKmJNdpWEnJCIVP2I0WcdhZenFEACyLoRk MvVvpbn6QHOReW/vG7CXWjHoTrWs6KUKhATHfiBEHn+P9pHvi+c2XuZPC5/5iEXrwL 2d7wrj+LF1e34BiflCNoGTyo2rxP4G+KM0YwdOBX1lnyj3aeUlMWirs1Ww2g+bm3Fc /RlHf8XN5HcRg9dd5/ERnWxa4n1mqKH6MIg1UBEqQGFSkRYRfRMPo/UB/SLX5or24w JqrRx+u7QYu4jdiuZBGFUbungn/yZLTQ38AMR/N7On3xnKyDwZhegPOPKhwm7xrOOU WijcYr12EU32Q== Date: Tue, 20 Sep 2022 17:45:29 -0700 From: Jakub Kicinski To: Liang He Cc: tchornyi@marvell.com, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, linux@armlinux.org.uk, netdev@vger.kernel.org Subject: Re: [PATCH] net: marvell: Fix refcounting bugs in prestera_port_sfp_bind() Message-ID: <20220920174529.3e8e106d@kernel.org> In-Reply-To: <20220915040655.4007281-1-windhl@126.com> References: <20220915040655.4007281-1-windhl@126.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, 15 Sep 2022 12:06:55 +0800 Liang He wrote: > In prestera_port_sfp_bind(), there are two refcounting bugs: > (1) we should call of_node_get() before of_find_node_by_name() as > it will automaitcally decrease the refcount of 'from' argument; > (2) we should call of_node_put() for the break of the iteration > for_each_child_of_node() as it will automatically increase and > decrease the 'child'. > > Fixes: 52323ef75414 ("net: marvell: prestera: add phylink support") > Signed-off-by: Liang He Please repost and CC all the authors of the patch under Fixes.