From: David Miller <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
Date: Tue, 18 Aug 2020 13:13:44 -0700 (PDT) [thread overview]
Message-ID: <20200818.131344.848165078661661080.davem@davemloft.net> (raw)
In-Reply-To: <20200818185241.22277-1-sylphrenadin@gmail.com>
From: Sumera Priyadarsini <sylphrenadin@gmail.com>
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 <sylphrenadin@gmail.com>
These OF iterators are so error prone...
Applied, thanks.
prev parent reply other threads:[~2020-08-18 20:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-18 18:52 Sumera Priyadarsini
2020-08-18 20:13 ` David Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200818.131344.848165078661661080.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=Julia.Lawall@lip6.fr \
--cc=claudiu.manoil@nxp.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sylphrenadin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®