Re: [PATCH v2 6/6] drivers: remoteproc: Add Xilinx r5 remoteproc driver
From: Lars-Peter Clausen <lars@metafoo.de>
Date: 2021-12-13 19:43:24
Also in:
linux-devicetree, linux-remoteproc, lkml
From: Lars-Peter Clausen <lars@metafoo.de>
Date: 2021-12-13 19:43:24
Also in:
linux-devicetree, linux-remoteproc, lkml
On 12/13/21 8:31 PM, Tanmay Shah wrote:
quoted
quoted
+static int zynqmp_r5_cluster_init(struct zynqmp_r5_cluster *cluster) +{ [...] + + i = 0; + for_each_available_child_of_node(dev_node, child) { + child_pdev = of_find_device_by_node(child); + if (!child_pdev)A return or a break in a for_each_available_child_of_node() will leak the reference to the child node.Do you mean I have to use of_put_node for each child?
You have to put a `of_put_node(child)` before each break or return in the loop. If you search the kernel commit history for for_each_available_child_of_node or for_each_child_of_node you'll find many fixes for similar problems. For example https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e1b391e9712db _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel