lkml.org 
[lkml]   [2015]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 2/4] dmaengine: Add STM32 DMA driver
From
Date
On 14/10/15 08:54, M'boumba Cedric Madianga wrote:
>>> +static int stm32_dma_alloc_chan_resources(struct dma_chan *c)
>>> +{
>>> + struct stm32_dma_chan *chan = to_stm32_dma_chan(c);
>>> + struct stm32_dma_device *dmadev = stm32_dma_chan_get_dev(chan);
>>> + int ret;
>>> +
>>> + chan->config_init = false;
>>> + ret = clk_prepare_enable(dmadev->clk);
>>> + if (ret < 0) {
>>> + dev_err(chan2dev(chan), "clk_prepare_enable failed: %d\n",
>>> ret);
>>> + return ret;
>>> + }
>>> +
>>> + ret = stm32_dma_disable_chan(chan);
>>> +
>>> + return ret;
>>> +}
>>
>>
>> The error path here looks like it will leak clock references.
>
> Sorry I didn't catch it. What does it mean ?

If stm32_dma_disable_chan() returns an error then we will not restore
the original the clock counts causing them to "leak".


Daniel.


\
 
 \ /
  Last update: 2015-10-14 11:21    [W:0.076 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site