Skip to content

Commit 4baadda

Browse files
outman119broonie
authored andcommitted
regulator: bq257xx: Fix device node reference leak in bq257xx_reg_dt_parse_gpio()
In bq257xx_reg_dt_parse_gpio(), if fails to get subchild, it returns without calling of_node_put(child), causing the device node reference leak. Fixes: 981dd16 ("regulator: bq257xx: Add bq257xx boost regulator driver") Signed-off-by: Felix Gu <ustc.gu@gmail.com> Link: https://patch.msgid.link/20260224-bq257-v1-1-8ebbc731c1c3@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 0902010 commit 4baadda

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/regulator/bq257xx-regulator.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,10 @@ static void bq257xx_reg_dt_parse_gpio(struct platform_device *pdev)
115115
return;
116116

117117
subchild = of_get_child_by_name(child, pdata->desc.of_match);
118+
of_node_put(child);
118119
if (!subchild)
119120
return;
120121

121-
of_node_put(child);
122-
123122
pdata->otg_en_gpio = devm_fwnode_gpiod_get_index(&pdev->dev,
124123
of_fwnode_handle(subchild),
125124
"enable", 0,

0 commit comments

Comments
 (0)