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 9DEE0C433FE for ; Tue, 22 Nov 2022 06:59:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232244AbiKVG7l (ORCPT ); Tue, 22 Nov 2022 01:59:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229750AbiKVG7i (ORCPT ); Tue, 22 Nov 2022 01:59:38 -0500 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D07542F3B9; Mon, 21 Nov 2022 22:59:36 -0800 (PST) Received: (Authenticated sender: peter@korsgaard.com) by mail.gandi.net (Postfix) with ESMTPSA id 8559B1BF208; Tue, 22 Nov 2022 06:59:33 +0000 (UTC) Received: from peko by dell.be.48ers.dk with local (Exim 4.94.2) (envelope-from ) id 1oxNFk-00H6YC-EK; Tue, 22 Nov 2022 07:59:32 +0100 From: Peter Korsgaard To: Liu Shixin Cc: Vinod Koul , Michal Simek , , , Subject: Re: [PATCH] dmaengine: xilinx_dma: call of_node_put() when breaking out of for_each_child_of_node() References: <20221122021612.1908866-1-liushixin2@huawei.com> Date: Tue, 22 Nov 2022 07:59:32 +0100 In-Reply-To: <20221122021612.1908866-1-liushixin2@huawei.com> (Liu Shixin's message of "Tue, 22 Nov 2022 10:16:12 +0800") Message-ID: <8735ab5vaj.fsf@dell.be.48ers.dk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>>>> "Liu" == Liu Shixin writes: > Since for_each_child_of_node() will increase the refcount of node, we need > to call of_node_put() manually when breaking out of the iteration. > Fixes: 9cd4360de609 ("dma: Add Xilinx AXI Video Direct Memory Access Engine driver support") > Signed-off-by: Liu Shixin Acked-by: Peter Korsgaard > --- > drivers/dma/xilinx/xilinx_dma.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c > index 8cd4e69dc7b4..766017570488 100644 > --- a/drivers/dma/xilinx/xilinx_dma.c > +++ b/drivers/dma/xilinx/xilinx_dma.c > @@ -3141,8 +3141,10 @@ static int xilinx_dma_probe(struct platform_device *pdev) > /* Initialize the channels */ > for_each_child_of_node(node, child) { > err = xilinx_dma_child_probe(xdev, child); > - if (err < 0) > + if (err < 0) { > + of_node_put(child); > goto error; > + } > } > if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) { > -- > 2.25.1 -- Bye, Peter Korsgaard