Skip to content

Commit c71af4d

Browse files
Lorenzo Pieralisirobherring
authored andcommitted
of/irq: Fix OF node refcount in of_msi_get_domain()
In of_msi_get_domain() if the iterator loop stops early because an irq_domain match is detected, an of_node_put() on the iterator node is needed to keep the OF node refcount in sync. Add it. Signed-off-by: Lorenzo Pieralisi <[email protected]> Reviewed-by: Frank Li <[email protected]> Cc: Rob Herring <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Rob Herring (Arm) <[email protected]>
1 parent 119aaee commit c71af4d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/of/irq.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,8 +774,10 @@ struct irq_domain *of_msi_get_domain(struct device *dev,
774774

775775
of_for_each_phandle(&it, err, np, "msi-parent", "#msi-cells", 0) {
776776
d = irq_find_matching_host(it.node, token);
777-
if (d)
777+
if (d) {
778+
of_node_put(it.node);
778779
return d;
780+
}
779781
}
780782

781783
return NULL;

0 commit comments

Comments
 (0)