提交 f22eb140 编写于 作者: L Lars-Peter Clausen 提交者: Vinod Koul

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: NLars-Peter Clausen <lars@metafoo.de>
Acked-by: NArnd Bergmann <arnd@arndb.de>
Reviewed-by: NJon Hunter <jon-hunter@ti.com>
Signed-off-by: NVinod Koul <vinod.koul@intel.com>
上级 af31826d
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册