Commit c71af4d6 authored by Lorenzo Pieralisi's avatar Lorenzo Pieralisi Committed by Rob Herring (Arm)
Browse files

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: default avatarLorenzo Pieralisi <lpieralisi@kernel.org>
Reviewed-by: default avatarFrank 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: default avatarRob Herring (Arm) <robh@kernel.org>
parent 119aaeed
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -774,9 +774,11 @@ struct irq_domain *of_msi_get_domain(struct device *dev,

	of_for_each_phandle(&it, err, np, "msi-parent", "#msi-cells", 0) {
		d = irq_find_matching_host(it.node, token);
		if (d)
		if (d) {
			of_node_put(it.node);
			return d;
		}
	}

	return NULL;
}