devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Nishka Dasgupta <nishkadg.linux@gmail.com>
Cc: robh+dt@kernel.org, frowand.list@gmail.com, devicetree@vger.kernel.org
Subject: Re: [PATCH] of: unittest: Add of_node_put() before return
Date: Tue, 27 Aug 2019 11:21:58 -0500	[thread overview]
Message-ID: <20190827162158.GA14084@bogus> (raw)
In-Reply-To: <20190815062218.5428-1-nishkadg.linux@gmail.com>

On Thu, 15 Aug 2019 11:52:18 +0530, Nishka Dasgupta wrote:
> The local variable np in function of_unittest_platform_populate takes
> the return value of of_find_node_by_path, which gets a node but does not
> put it. If np is not put before return it may cause a memory leak. Hence
> put np before a return statement.
> Issue found with Coccinelle.
> 
> Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
> ---
>  drivers/of/unittest.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 

Applied, thanks.

Rob

      reply	other threads:[~2019-08-27 16:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-15  6:22 [PATCH] of: unittest: Add of_node_put() before return Nishka Dasgupta
2019-08-27 16:21 ` Rob Herring [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=20190827162158.GA14084@bogus \
    --to=robh@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=nishkadg.linux@gmail.com \
    --cc=robh+dt@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).