Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp822710pxb; Fri, 22 Apr 2022 11:57:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLWCw7XCrsAWf7ODKVjadFAInGvvk4C0a7qFjbaLTG4pppC1XEc1U8gZNratHMByBAAiD3 X-Received: by 2002:a17:902:a710:b0:156:5650:f94a with SMTP id w16-20020a170902a71000b001565650f94amr5871378plq.86.1650653843662; Fri, 22 Apr 2022 11:57:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650653843; cv=none; d=google.com; s=arc-20160816; b=FQ+yGkQaTRDaJ2nzK581vZlRoRBNWk4PyQ2qQiHtRB18s0lotlZMFLgGvZ0cSOwwdq W+fBi66j8049/WlLjrfz1AxPHPf0rXX3d7iq1ExpXZNdrKMUaBJ4g+enZZ2DDOr3mHrG Cmwe+Wsqv+yiGz1E0CM2WWl2fDVTJMWlMXYFPj60x5/jIBhBnrXxlyWAtT1QyquM6ViX N6WfroIK95g3Z3XK8R5rG50GpOIrDKAIXnIcrQaehUrlTN9VS42FLxSp3I1j+4fpbE33 S8zlNWXRBQWOpH0WLDoUK/cAgF0jSrK8xtdiQMQzWI6js8f30K55LspveiNqmM9eEol3 WJtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=R0boMgBVhfhsBSHzBazcolacXIHxsl2dCVBxaqZlwyk=; b=YiShTjEi0Ie3PlL4cWZzMHE8gBUj+jRzhhp3bBWWs3jZs+B1jeiVwwYQJ3ossfo1Oa WDIT9jluuBoJcR6pOt8aq0tppafNoFeRLlRYsekkJtA++q2m/uWpxiVB6pfW/8uvjS20 CAD0vGw0pddjuxFzkCVzNrDI6NH/Yw5kkEdkgjNhhfUCBIviu0/mnF1Ds48rTI2XRqTa FZmWcY1piQE/SpmTBoqh6tipOi0ytWjy/BAM+mXaoLN5mTXZLhQTst5NA9u1zUZ9y0FW WkjESLhbinbeNti9qsg8X1+lMyAzXOtcSw8aPao+IRHy7mzXdRDtlTS7Xbp3cB62aVFD Gnrw== 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:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id h7-20020a63e147000000b003a2ece8b92bsi9400982pgk.219.2022.04.22.11.57.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 11:57:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DB8FFCC500; Fri, 22 Apr 2022 11:20:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1444331AbiDVGUn (ORCPT + 99 others); Fri, 22 Apr 2022 02:20:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444330AbiDVGUj (ORCPT ); Fri, 22 Apr 2022 02:20:39 -0400 Received: from mail.meizu.com (unknown [14.29.68.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79265506F3; Thu, 21 Apr 2022 23:17:23 -0700 (PDT) Received: from IT-EXMB-1-125.meizu.com (172.16.1.125) by mz-mail04.meizu.com (172.16.1.16) with Microsoft SMTP Server (TLS) id 14.3.487.0; Fri, 22 Apr 2022 14:17:25 +0800 Received: from [172.16.137.70] (172.16.137.70) by IT-EXMB-1-125.meizu.com (172.16.1.125) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Fri, 22 Apr 2022 14:17:19 +0800 Message-ID: Date: Fri, 22 Apr 2022 14:17:18 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH] dmaengine: imx-sdma: Remove useless null check before call of_node_put() To: Vinod Koul CC: Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , , , References: <1650509390-26877-1-git-send-email-baihaowen@meizu.com> From: baihaowen In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [172.16.137.70] X-ClientProxiedBy: IT-EXMB-1-126.meizu.com (172.16.1.126) To IT-EXMB-1-125.meizu.com (172.16.1.125) X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE autolearn=unavailable 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 在 4/22/22 2:10 PM, Vinod Koul 写道: > On 21-04-22, 10:49, Haowen Bai wrote: >> No need to add null check before call of_node_put(), since the >> implementation of of_node_put() has done it. >> >> Signed-off-by: Haowen Bai >> --- >> drivers/dma/imx-sdma.c | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c >> index 6196a7b3956b..b8a1299b93f0 100644 >> --- a/drivers/dma/imx-sdma.c >> +++ b/drivers/dma/imx-sdma.c >> @@ -1933,8 +1933,7 @@ static int sdma_event_remap(struct sdma_engine *sdma) >> } >> >> out: >> - if (gpr_np) >> - of_node_put(gpr_np); >> + of_node_put(gpr_np); > this is incorrect as it is called on error case > > Even through it is called on error case, gpr_np=null, but  of_node_put did a null check. void of_node_put(struct device_node *node) { if (node) kobject_put(&node->kobj); } -- Haowen Bai