Skip to content

Commit 5c3daa5

Browse files
outman119Bartosz Golaszewski
authored andcommitted
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. Fixes: 52e7b5b ("power: sequencing: Add the Power Sequencing driver for the PCIe M.2 connectors") Signed-off-by: Felix Gu <ustc.gu@gmail.com> Link: https://patch.msgid.link/20260302-m2-v1-1-a6533e18aa69@gmail.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
1 parent 11439c4 commit 5c3daa5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/power/sequencing/pwrseq-pcie-m2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static int pwrseq_pcie_m2_probe(struct platform_device *pdev)
109109
if (!ctx)
110110
return -ENOMEM;
111111

112-
ctx->of_node = of_node_get(dev->of_node);
112+
ctx->of_node = dev_of_node(dev);
113113
ctx->pdata = device_get_match_data(dev);
114114
if (!ctx->pdata)
115115
return dev_err_probe(dev, -ENODEV,

0 commit comments

Comments
 (0)