Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3360517pxa; Tue, 18 Aug 2020 13:18:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfDxxYP9J03wCJrMsEBtcms0pCF5Bkx+DkzSkN2FIM36kCV3uvRQ0YAHIaoPWjHZOqSUDx X-Received: by 2002:a17:907:2087:: with SMTP id pv7mr21394976ejb.452.1597781883813; Tue, 18 Aug 2020 13:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597781883; cv=none; d=google.com; s=arc-20160816; b=YSSWVPA4MIMdEDkf2yY236gffQt6cWXSIn9Q/NN+sbfeP3ba6G0HFqBjiZJX2D2VpZ aKvDExiCDQS1mJBJS1PaVK6y/MGi+3owPnPmTlDpkxOEmL4UycfZM1BNXUJ0VukGSbDV jy6B617jUhSJVzrKqyXyO7uzF1qNsvxsVxmnMwjimGM4gWsRhQBUE0Eyw3CKnY3z2Lar h9ZHiUk2A0kOScncXjvk98rmoqsgMw7OhzjVNtF1NAzdSRsRJSm4eHV4rpu03saH8f+Z DK77EqCG+wkzyoXJw9pgQn+6vd9LJFthNt/bsclYSiSo7LDMiiVVxPrf7UpaUfvGUH3F B4OA== 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=u0KsD+QxXVij+IEWjOAPWMD5iksxclvXwlG1gogpQ+Y=; b=j0ietNvuQ0Ve73bW9hFpCsm7e+LdhvnNeG4b6f5x+GruRqe+UTAsoNNZl1h0K/sf1i nKLCqgn/K6puNH7lEddBsKfXtNB94TChiSivTYR4wP2FiDv9Yeho4UPicpx87b5eBWkc ipM8kboPEhcJ0Ds4qu1v71/5MqFFfXzulkDDSH3DqzVarhwwYguNMYZr92d1sUCkxGCf 3Uaqj4t2yvTrx55LPA+LKfJOmfoRNmMIyvZRGnHtovh1n5JCYlpLEGMWS8lehL2b42/4 JMEFuSeWwmTl90Qg7w1PwvH3OVzYbn2XLk/k/KMiBwdm2rfC1XV267o4vhXFgyTYjQhD sQAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bm20si13132955edb.583.2020.08.18.13.17.33; Tue, 18 Aug 2020 13:18:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726809AbgHRUNs (ORCPT + 99 others); Tue, 18 Aug 2020 16:13:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726318AbgHRUNq (ORCPT ); Tue, 18 Aug 2020 16:13:46 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44DB4C061389; Tue, 18 Aug 2020 13:13:46 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (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 5467B127B291C; Tue, 18 Aug 2020 12:56:59 -0700 (PDT) Date: Tue, 18 Aug 2020 13:13:44 -0700 (PDT) Message-Id: <20200818.131344.848165078661661080.davem@davemloft.net> To: sylphrenadin@gmail.com Cc: claudiu.manoil@nxp.com, kuba@kernel.org, Julia.Lawall@lip6.fr, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: gianfar: Add of_node_put() before goto statement From: David Miller In-Reply-To: <20200818185241.22277-1-sylphrenadin@gmail.com> References: <20200818185241.22277-1-sylphrenadin@gmail.com> X-Mailer: Mew version 6.8 on Emacs 26.3 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, 18 Aug 2020 12:56:59 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sumera Priyadarsini Date: Wed, 19 Aug 2020 00:22:41 +0530 > Every iteration of for_each_available_child_of_node() decrements > reference count of the previous node, however when control > is transferred from the middle of the loop, as in the case of > a return or break or goto, there is no decrement thus ultimately > resulting in a memory leak. > > Fix a potential memory leak in gianfar.c by inserting of_node_put() > before the goto statement. > > Issue found with Coccinelle. > > Signed-off-by: Sumera Priyadarsini These OF iterators are so error prone... Applied, thanks.