Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8987393ybi; Tue, 23 Jul 2019 19:31:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqzM5m4GLLwCydR1OZOwAV9/6/b/b4WfBj/c9VV1zuVjtYtW8JA73MfKO0UrCABReuEQzu+5 X-Received: by 2002:a63:6bc5:: with SMTP id g188mr48667093pgc.225.1563935513125; Tue, 23 Jul 2019 19:31:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563935513; cv=none; d=google.com; s=arc-20160816; b=DrfSEs1/4OlSG6reltbuxjBhFWixhEy8tHZr4Ix/tlBnLwxHfaPXeS6CJ5FNLsQSRP 7Ye/4eSR7mWO+9nV8oF+3J9zCQUOUPelENTkJcP3w8P3zqszlfBqXKBbDjJPaa0us3EX EsBM9zmM6ejd7qIH0PzB5j6vvxqv6a7AoH1jONUtqd5jwEETC8sj0aKoqlosmIOUIoeT dLBpNq9lFYHRaLoqK7gst6xmgwQv0yUL6ZaqMVnb3fo6cul0+7m3nT5jX1ubaMlEDoFv tjtTEcNGsHLBpl3k9OsxZpQmyv/D6Q8fIAWRsW6sgAZxXjA+8VFLFQejHdwi6aw8/4ju Kflg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=Cgvd1MVy6D2WI2J+qXTCjM3YjpmYqBwnA3QQQaoCJDA=; b=H4AJ7HjBWTMsCXXtTkEQGLEE+UCqspsQ+FecJLI5DpZREBu6OTr9xMvQymmrij0uVt 5CWL0MPpKXz3bvqe5BPwPZRBn6e0ssHeJETwd5AfTMpGqM9OPANHLGIP0EsWT9s5e8YA EvLC9r4CbavpKLWAhS/lA7nfD8dmjGPsomaPPhuYykqON84FxPlJ5PwqPqsgds4JdwDx LcHX8NdX/7V/G01fUZcWO1zmZk32kt2BilqpsoUwKmc96K6nEFMGhnUhPPn4TFSGpk2u ToYH07PhtOvBsu35ziroqlHfiwG4m8MBerJL6TS3RU5nT38BL96dAG+AINSYAzqo+d2t rjVA== 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 9si13272078pgo.283.2019.07.23.19.31.37; Tue, 23 Jul 2019 19:31:53 -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 S2389081AbfGWUi5 (ORCPT + 99 others); Tue, 23 Jul 2019 16:38:57 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:36418 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726920AbfGWUi5 (ORCPT ); Tue, 23 Jul 2019 16:38:57 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::d71]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 0A35E153BE24F; Tue, 23 Jul 2019 13:38:57 -0700 (PDT) Date: Tue, 23 Jul 2019 13:38:56 -0700 (PDT) Message-Id: <20190723.133856.860402214064308020.davem@davemloft.net> To: nishkadg.linux@gmail.com Cc: olteanv@gmail.com, andrew@lunn.ch, vivien.didelot@gmail.com, f.fainelli@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: dsa: sja1105: sja1105_main: Add of_node_put() From: David Miller In-Reply-To: <20190723104448.8125-1-nishkadg.linux@gmail.com> References: <20190723104448.8125-1-nishkadg.linux@gmail.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Tue, 23 Jul 2019 13:38:57 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nishka Dasgupta Date: Tue, 23 Jul 2019 16:14:48 +0530 > Each iteration of for_each_child_of_node puts the previous node, but in > the case of a return from the middle of the loop, there is no put, thus > causing a memory leak. Hence add an of_node_put before the return. > Issue found with Coccinelle. > > Signed-off-by: Nishka Dasgupta Applied. Again, the semantics of these looping constructs are terrible.