Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

of: device: Fix missing of_node_put() in of_dma_set_restricted_buffer

We should use of_node_put() for the reference 'node' returned by
of_parse_phandle() which will increase the refcount.

Fixes: fec9b625095f ("of: Add plumbing for restricted DMA pool")
Co-authored-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Liang He <windhl@126.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220702014449.263772-1-windhl@126.com

authored by

Liang He
Miaoqian Lin
and committed by
Rob Herring
d17e37c4 9465a984

+4 -1
+4 -1
drivers/of/device.c
··· 81 81 * restricted-dma-pool region is allowed. 82 82 */ 83 83 if (of_device_is_compatible(node, "restricted-dma-pool") && 84 - of_device_is_available(node)) 84 + of_device_is_available(node)) { 85 + of_node_put(node); 85 86 break; 87 + } 88 + of_node_put(node); 86 89 } 87 90 88 91 /*