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 <lpieralisi@kernel.org> Reviewed-by: Frank Li <Frank.Li@nxp.com> Cc: Rob Herring <robh@kernel.org> Link: https://patch.msgid.link/20251021124103.198419-3-lpieralisi@kernel.org Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
1 parent 119aaee commit c71af4d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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)