Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 981dd162b635 ("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>

authored by

Felix Gu and committed by
Mark Brown
4baaddaa 0902010c

+1 -2
+1 -2
drivers/regulator/bq257xx-regulator.c
··· 115 115 return; 116 116 117 117 subchild = of_get_child_by_name(child, pdata->desc.of_match); 118 + of_node_put(child); 118 119 if (!subchild) 119 120 return; 120 - 121 - of_node_put(child); 122 121 123 122 pdata->otg_en_gpio = devm_fwnode_gpiod_get_index(&pdev->dev, 124 123 of_fwnode_handle(subchild),