Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1242390imm; Wed, 23 May 2018 12:39:57 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoG/D8xfr+Ky876/oSMufPJAGtSbXZhUKDdf2sAlZoxGYT8jeItlkOHEb0hq9G0y3Fqaqt9 X-Received: by 2002:a63:9843:: with SMTP id l3-v6mr3390332pgo.208.1527104397159; Wed, 23 May 2018 12:39:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527104397; cv=none; d=google.com; s=arc-20160816; b=G1GOUdQHPrXnXSudepyYDZMGzgyYaAM5QR+AbrdCZtQf1gch/6gCgducuhcUb2KOts r6511yuVqfyBlOkx17vISBRQnbrl0MSYU7HaDWkfCLsZnKSTzQ5xDbdNTh28lgMTFCSc NBu3chQZ6DSJ9wuj91On5m2+sWcrBNFqn8rPKnoEtc1w3is/t8C3Toa9ynPgQ40o86Xi NoELuTpbLNZcpm9v5/+MAsBkPAGFhR+7dUY4lAogwrl2RCh9FhRVmRKT0I+VdB2Y6JtU 5qkcI3xDaJjkMWV3Kw3Eh/f422pExAeLZmjqSHwexxXCmeJRnSRblf/+kJ8aVM4TtX6o Ynkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=xTxLrbDxo/9XVKstpDUVfpApAOf+LZ4pdgLN0vOqfOI=; b=jKd932xZu4y5zS/+96k0GnbFW0heslPsQd+K5Q3omQSAcBOQNC1ZkASp+FVPDM7P1w hMu+lKl0AtMGGXcd8xZOFUpudCVkagt5VvbCQ0T0elK/GaPk0wlYYtuaNtpsD9CmEAEO Iv0nGzQO/4m/ybSkAKyqlVwySWJ6Yo91QhLykclxaJ4T3dnh0qt4LeheroQO5AXEKGyX hahT3dCeiNYsvNy6lX72FoASFy/fQ7TSeRk2/ok8yunPVAJinjL9j8bqumLDNBn0Zdya EQEwO99IdCdJDQX2DlOfTYM3TfSetdGVaVVc9VgqmoqH1OXdlPrT5+0RMLb3q909duV9 RnUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l186-v6si20058156pfl.155.2018.05.23.12.39.42; Wed, 23 May 2018 12:39:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934504AbeEWTjH (ORCPT + 99 others); Wed, 23 May 2018 15:39:07 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:30112 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934286AbeEWTjD (ORCPT ); Wed, 23 May 2018 15:39:03 -0400 X-IronPort-AV: E=Sophos;i="5.49,434,1520895600"; d="scan'208";a="328129392" Received: from palace.lip6.fr (HELO localhost.localdomain) ([132.227.105.202]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES128-SHA256; 23 May 2018 21:38:58 +0200 From: Julia Lawall To: Santosh Shilimkar Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/5] soc: ti: knav_dma: add missing of_node_put Date: Wed, 23 May 2018 21:07:14 +0200 Message-Id: <1527102436-13447-4-git-send-email-Julia.Lawall@lip6.fr> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1527102436-13447-1-git-send-email-Julia.Lawall@lip6.fr> References: <1527102436-13447-1-git-send-email-Julia.Lawall@lip6.fr> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The device node iterators perform an of_node_get on each iteration, so a jump out of the loop requires an of_node_put. The semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr): // @@ expression root,e; local idexpression child; iterator name for_each_child_of_node; @@ for_each_child_of_node(root, child) { ... when != of_node_put(child) when != e = child + of_node_put(child); ? break; ... } ... when != child // Signed-off-by: Julia Lawall --- drivers/soc/ti/knav_dma.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/soc/ti/knav_dma.c b/drivers/soc/ti/knav_dma.c index 224d7dd..bda3173 100644 --- a/drivers/soc/ti/knav_dma.c +++ b/drivers/soc/ti/knav_dma.c @@ -768,6 +768,7 @@ static int knav_dma_probe(struct platform_device *pdev) ret = dma_init(node, child); if (ret) { dev_err(&pdev->dev, "init failed with %d\n", ret); + of_node_put(child); break; } }