dmaengine: xilinx_dma: call of_node_put() when breaking out of for_each_child_of_node()
Message ID | 20221122021612.1908866-1-liushixin2@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1940372wrr; Mon, 21 Nov 2022 17:31:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf54mSbkVJ2cGGaGSmwhJuTnKnCMMCIddCHrjA1IdYURDwBeCjNQEAECKDp91YUPwkT86PZ5 X-Received: by 2002:a17:906:5db2:b0:7ae:d58b:30f8 with SMTP id n18-20020a1709065db200b007aed58b30f8mr1506935ejv.564.1669080704020; Mon, 21 Nov 2022 17:31:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669080704; cv=none; d=google.com; s=arc-20160816; b=WXq9MczjavnnjCItwI9ZwPRlqYZTkQrYeXB7Qj5OSEMHvI86zfPe+BU1ow8WrOW4FV fUHTPUWD0fj5/hgPSGM3K88aKy/zlrJPNC5iZQueHMW/i/aV3jUCZhDkBHANaiEIFpiB BatD0iUQVhSsLpQKjtbJY5xUUHljdX08Y8HQdyYEfupsDZV2s8ltnuhf/HBWlyOqUt2N U0FqbO0jm+zHyCdLJRGaDek4pZ4QT/7/wnu+bLhmHa6AhuxqvvbiB0URc9LCHCMLUv6i gMxgo7DlAU+A3vw1EoTAMnj/Vauu9QkJDQj9aiSQYrbNYfRB1YT0F+G1ZEvOpYrg7wHd yp3A== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v22-20020a056402349600b00467570d605esi11645345edc.608.2022.11.21.17.31.19; Mon, 21 Nov 2022 17:31:44 -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 <rfc822;cjcooper78@gmail.com> + 99 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <liushixin2@huawei.com> To: Vinod Koul <vkoul@kernel.org>, Michal Simek <michal.simek@xilinx.com> CC: <dmaengine@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org>, Liu Shixin <liushixin2@huawei.com> 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750157968760873897?= X-GMAIL-MSGID: =?utf-8?q?1750157968760873897?= |
Series |
dmaengine: xilinx_dma: call of_node_put() when breaking out of for_each_child_of_node()
|
|
Commit Message
Liu Shixin
Nov. 22, 2022, 2:16 a.m. UTC
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 <liushixin2@huawei.com>
---
drivers/dma/xilinx/xilinx_dma.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Comments
>>>>> "Liu" == Liu Shixin <liushixin2@huawei.com> 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 <liushixin2@huawei.com> Acked-by: Peter Korsgaard <peter@korsgaard.com> > --- > 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
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) {