[PATCH] firmware: arm_scpi: Fix a reference leak on device node

Felix Gu gu_0233 at qq.com
Fri Jan 16 04:54:39 PST 2026


When calling of_parse_phandle_with_args(), the caller is responsible
to call of_node_put() to release the reference of device node.
In scpi_dev_domain_id, it does not release the reference.

Fixes: 45ca7df7c345 ("firmware: arm_scpi: add support to populate OPPs and get transition latency")

Signed-off-by: Felix Gu <gu_0233 at qq.com>
---
 drivers/firmware/arm_scpi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/firmware/arm_scpi.c b/drivers/firmware/arm_scpi.c
index 87c323de17b9..b6233f81ef3e 100644
--- a/drivers/firmware/arm_scpi.c
+++ b/drivers/firmware/arm_scpi.c
@@ -665,6 +665,7 @@ static int scpi_dev_domain_id(struct device *dev)
 				       0, &clkspec))
 		return -EINVAL;
 
+	of_node_put(clkspec.np);
 	return clkspec.args[0];
 }
 

---
base-commit: 9b7977f9e39b7768c70c2aa497f04e7569fd3e00
change-id: 20260116-arm_scpi-0132a9eee0c2

Best regards,
-- 
Felix Gu <gu_0233 at qq.com>




More information about the linux-arm-kernel mailing list