aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2013-04-19 05:42:13 -0400
committerVinod Koul <vinod.koul@intel.com>2013-05-02 12:20:38 -0400
commitf22eb1402244885126c4263eb36b857e4182dd6f (patch)
tree7767872c251466aa91c09fb85efd957418f4bf03 /drivers/dma
parentaf31826d9b1ce432e033f0e91529aa1013076482 (diff)
dma: of: Fix of_node reference leak
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> Acked-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Jon Hunter <jon-hunter@ti.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/of-dma.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c
index 8266893fef45..2882403a39cf 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,
221 221
222 ofdma = of_dma_get_controller(&dma_spec); 222 ofdma = of_dma_get_controller(&dma_spec);
223 223
224 if (!ofdma) 224 if (ofdma) {
225 continue; 225 chan = ofdma->of_dma_xlate(&dma_spec, ofdma);
226
227 chan = ofdma->of_dma_xlate(&dma_spec, ofdma);
228 226
229 of_dma_put_controller(ofdma); 227 of_dma_put_controller(ofdma);
228 } else {
229 chan = NULL;
230 }
230 231
231 of_node_put(dma_spec.np); 232 of_node_put(dma_spec.np);
232 233