Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5187585rwb; Mon, 21 Nov 2022 18:18:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf7E6RnnXUDDv8jd++F3Pras3T32KJOGLmiZnhWbRQbdOTx43VBBs2zx8VrGZxbumS2SGAp4 X-Received: by 2002:a17:90a:dd83:b0:218:61bd:d00d with SMTP id l3-20020a17090add8300b0021861bdd00dmr26767260pjv.236.1669083519040; Mon, 21 Nov 2022 18:18:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669083519; cv=none; d=google.com; s=arc-20160816; b=vVt295dOoDPLSszfLuninGtEeMpClyKbqM28R4uKyPc9WDRgEk+ygH9vheSbmPhHwS R8rJtOYgRvcQ7aubNqd/7+I3TH7nFrZboJMZ85l7zIXBQ0CdWmXfOaJkqptTjLE4yTbD uK1aYJrZkQz+0IThxagzISXYsDXzMMroJAfbU1KQfjKMcfA0YVJ684mG22sh+g76qLEH ZF5PHyXLNrliuDTXxEYV24crvrqXt3MkNyFR9uJtO8Mby7+ymOgz/LAQgyOKzjA5HQI+ b0T7SVqqzjC7Z9dW6/MjxB6ETbdBMDtO/Xtvrnq/Y7PrmgY7HDiGAPEYaJbxLpgNe6Iy tiew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=3s652HCc22gDtG25Cm9mPlaGs6qTWMw3zhwB92jI2Vk=; b=jvF+ugzpwFwrZLcRI+0sJGQ8ueAGrZzJFzswkGKt0/Q4vk0J39XZWdO33QHGqZ+4HQ 5d3fH46eQfSIHw9Q+5X9cXaQDN5o7XxkJc1FGugJcshU7GpB6NTnLZHnj5UJeuuEWi7M wMB2eOY1vXHLVqC6bYJ4ykMgRBmOnTrBVTWJlXhKeBCUqMrH7406Dq3m6QZVYm8V7rld JqPRhHVzKjosRbhCsucR6pud2YCny+WoqoFCs5ne6Z6SvyAsrnxg7HqWgx2HcVjKVlzF 8H6ZPDpbha9vukNpwqLXzLrdcz31lVWwKiiDQ8UdKlulNfkqePu7voCjcY2vXiCv4UwX geZQ== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w3-20020a170902e88300b00188dba5d7dbsi14343635plg.78.2022.11.21.18.18.28; Mon, 21 Nov 2022 18:18:39 -0800 (PST) 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232224AbiKVB3D (ORCPT + 91 others); Mon, 21 Nov 2022 20:29:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231771AbiKVB3A (ORCPT ); Mon, 21 Nov 2022 20:29:00 -0500 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42D7897A82; Mon, 21 Nov 2022 17:28:59 -0800 (PST) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4NGRQv08jHzFqVB; Tue, 22 Nov 2022 09:25:43 +0800 (CST) Received: from dggpemm100009.china.huawei.com (7.185.36.113) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 22 Nov 2022 09:28:57 +0800 Received: from huawei.com (10.175.113.32) by dggpemm100009.china.huawei.com (7.185.36.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 22 Nov 2022 09:28:57 +0800 From: Liu Shixin To: Vinod Koul , Michal Simek CC: , , , Liu Shixin Subject: [PATCH] dmaengine: xilinx_dma: call of_node_put() when breaking out of for_each_child_of_node() Date: Tue, 22 Nov 2022 10:16:12 +0800 Message-ID: <20221122021612.1908866-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm100009.china.huawei.com (7.185.36.113) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 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 --- 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