linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Sinan Kaya <okaya@kernel.org>
Cc: Nishka Dasgupta <nishkadg.linux@gmail.com>,
	agross@kernel.org, dan.j.williams@intel.com,
	linux-arm-kernel@lists.infradead.org,
	linux-arm-msm@vger.kernel.org, dmaengine@vger.kernel.org
Subject: Re: [PATCH v2] dma: qcom: hidma_mgmt: Add of_node_put() before goto
Date: Thu, 8 Aug 2019 17:57:56 +0530	[thread overview]
Message-ID: <20190808122756.GS12733@vkoul-mobl.Dlink> (raw)
In-Reply-To: <eab2555a-07ad-9e48-14d4-e34417d52fbb@kernel.org>

On 24-07-19, 13:25, Sinan Kaya wrote:
> On 7/24/2019 4:16 AM, Nishka Dasgupta wrote:
> > Each iteration of for_each_available_child_of_node puts the previous
> > node, but in the case of a goto from the middle of the loop, there is
> > no put, thus causing a memory leak. 
> > Hence add an of_node_put under the label that the gotos point to.
> > In order to avoid decrementing an already-decremented refcount, copy the
> > original contents of the label (including the return statement) to just
> > above the label, so that the code under the label is executed only when
> > a goto exit from the loop occurs.
> > Additionally, remove an unnecessary get/put pair from the loop, as the
> > loop itself already keeps track of refcount.
> > Issue found with Coccinelle.
> > 
> > Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
> 
> nit: please post v3 with dmaengine:qcom:hidma_mgmt:....
> 
> Vinod doesn't like commit subjectss in this directory to have dma name
> on it. You can keep my acked-by.

That's right but I am okay to hand edit while applying for drive by
contributors :) so applied with you ack

> Acked-by: Sinan Kaya <okaya@kernel.org>
> 

-- 
~Vinod

      reply	other threads:[~2019-08-08 12:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-24  8:16 [PATCH v2] dma: qcom: hidma_mgmt: Add of_node_put() before goto Nishka Dasgupta
2019-07-24 17:25 ` Sinan Kaya
2019-08-08 12:27   ` Vinod Koul [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=20190808122756.GS12733@vkoul-mobl.Dlink \
    --to=vkoul@kernel.org \
    --cc=agross@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=nishkadg.linux@gmail.com \
    --cc=okaya@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).