power: sequencing: pcie-m2: Fix device node reference leak in probe
Subsystems (3)
PATCH 1/1 power: sequencing: pcie-m2: Fix device node reference leak in probe
In pwrseq_pcie_m2_probe(), ctx->of_node acquires an explicit reference to the device node using of_node_get(), but there is no corresponding of_node_put() in the driver's error handling paths or removal.
Since the ctx is tied to the lifecycle of the platform device, there is no need to hold an additional reference to the device's own of_node.
--- drivers/power/sequencing/pwrseq-pcie-m2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/sequencing/pwrseq-pcie-m2.c +1 -1
@@ -109,7 +109,7 @@ static int pwrseq_pcie_m2_probe(struct platform_device *pdev)if (!ctx)return -ENOMEM ; - ctx->of_node =of_node_get (dev->of_node); + ctx->of_node =dev_of_node (dev); ctx->pdata =device_get_match_data (dev);if (!ctx->pdata) return dev_err_probe(dev, -ENODEV,
---
base-commit: 3fa5e5702a82d259897bd7e209469bc06368bf31
change-id: 20260302-m2-f638d393632e
Best regards,
Signature · 1 line
Felix Gu <[email protected]>
Bartosz Golaszewski
AppliedQuoted 8 lines · Felix Gu
In
pwrseq_pcie_m2_probe(),ctx->of_nodeacquires an explicit reference to the device node usingof_node_get(), but there is no correspondingof_node_put()in the driver's error handling paths or removal.Since the ctx is tied to the lifecycle of the platform device, there is no need to hold an additional reference to the device's own
of_node.[...]
Applied, thanks!
[1/1] power: sequencing: pcie-m2: Fix device node reference leak in probe
https://git.kernel.org/brgl/c/5c3daa5301693d2e5364483a3405649a0fdaed98
Best regards,
Signature · 1 line
Bartosz Golaszewski <[email protected]>