DORMANTno replies

[PATCH] macintosh: rack-meter: fix i2s device node reference leak

From: Guangshuo Li <hidden>
Date: 2026-09-14 14:14:55
Also in: lkml, stable
Subsystem: linux for power macintosh, the rest · Maintainer: Linus Torvalds

rackmeter_probe() obtains a reference to the i2s-a child node while
iterating over the device tree children. Since the loop exits with
break when the matching node is found, the reference to i2s remains
held by the caller.

The probe error paths correctly release both i2s and np, but the
successful probe path only releases np. This leaks the i2s device node
reference each time the driver is successfully bound.

The i2s node is only needed during probe, including by
rackmeter_setup_i2s(), and is not used after initialization has
completed. Drop its reference before returning successfully from
probe.

This issue was found by manual code inspection.

Fixes: 3e00a5aec3d6 ("[POWERPC] Xserve cpu-meter driver")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <redacted>
---
 drivers/macintosh/rack-meter.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c
index 26cb93191ede..c1c6d97d5013 100644
--- a/drivers/macintosh/rack-meter.c
+++ b/drivers/macintosh/rack-meter.c
@@ -496,6 +496,7 @@ static int rackmeter_probe(struct macio_dev* mdev,
 		goto bail_stop_dma;
 	}
 	of_node_put(np);
+	of_node_put(i2s);
 	return 0;
 
  bail_stop_dma:
-- 
2.43.0

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help