All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Arnd Bergmann <arnd@arndb.de>, Jon Hunter <jon-hunter@ti.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] dma: of: Fix of_node reference leak
Date: Thu, 2 May 2013 21:54:36 +0530	[thread overview]
Message-ID: <20130502162436.GL1960@intel.com> (raw)
In-Reply-To: <1366364534-3298-1-git-send-email-lars@metafoo.de>

On Fri, Apr 19, 2013 at 11:42:13AM +0200, Lars-Peter Clausen wrote:
> of_dma_request_slave_channel() currently does not drop the reference to the
> dma_spec of_node if no DMA controller matching the of_node could be found. This
> patch fixes it by always calling of_node_put().
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Applied both with minor typo fix in changelog for second.

Thanks
~Vinod
> ---
>  drivers/dma/of-dma.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c
> index 8266893..2882403 100644
> --- a/drivers/dma/of-dma.c
> +++ b/drivers/dma/of-dma.c
> @@ -221,12 +221,13 @@ struct dma_chan *of_dma_request_slave_channel(struct device_node *np,
>  
>  		ofdma = of_dma_get_controller(&dma_spec);
>  
> -		if (!ofdma)
> -			continue;
> -
> -		chan = ofdma->of_dma_xlate(&dma_spec, ofdma);
> +		if (ofdma) {
> +			chan = ofdma->of_dma_xlate(&dma_spec, ofdma);
>  
> -		of_dma_put_controller(ofdma);
> +			of_dma_put_controller(ofdma);
> +		} else {
> +			chan = NULL;
> +		}
>  
>  		of_node_put(dma_spec.np);
>  
> -- 
> 1.8.0
> 

      parent reply	other threads:[~2013-05-02 16:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-19  9:42 [PATCH 1/2] dma: of: Fix of_node reference leak Lars-Peter Clausen
2013-04-19  9:42 ` [PATCH 2/2] dma:of: Use a mutex to protect the of_dma_list Lars-Peter Clausen
2013-04-19 10:13   ` Arnd Bergmann
2013-04-19 11:04     ` Lars-Peter Clausen
2013-04-19 12:25       ` Arnd Bergmann
2013-04-19 22:45   ` Jon Hunter
2013-04-19 23:13     ` Arnd Bergmann
2013-04-22  1:22       ` Jon Hunter
2013-04-20  7:28     ` Lars-Peter Clausen
2013-04-20 10:38       ` Arnd Bergmann
2013-04-22  1:18         ` Jon Hunter
2013-04-19 10:10 ` [PATCH 1/2] dma: of: Fix of_node reference leak Arnd Bergmann
2013-04-19 22:29   ` Jon Hunter
2013-05-02 16:24 ` 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=20130502162436.GL1960@intel.com \
    --to=vinod.koul@intel.com \
    --cc=arnd@arndb.de \
    --cc=jon-hunter@ti.com \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.