mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
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 <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Reviewed-by: Jon Hunter <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
This commit is contained in:
parent
af31826d9b
commit
f22eb14022
1 changed files with 6 additions and 5 deletions
|
|
@ -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;
|
||||
if (ofdma) {
|
||||
chan = ofdma->of_dma_xlate(&dma_spec, 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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue