diff --git a/drivers/of/address.c b/drivers/of/address.c index da4f7341323f2..37ac311843090 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -1043,11 +1043,13 @@ out: */ bool of_dma_is_coherent(struct device_node *np) { - struct device_node *node = of_node_get(np); + struct device_node *node; if (IS_ENABLED(CONFIG_OF_DMA_DEFAULT_COHERENT)) return true; + node = of_node_get(np); + while (node) { if (of_property_read_bool(node, "dma-coherent")) { of_node_put(node);