regulator: s5m8767: Fix reference count leak
Subsystems (3)
PATCH 1/1 regulator: s5m8767: Fix reference count leak
Call of_node_put() to drop references of regulators_np and reg_np before returning error code.
--- drivers/regulator/s5m8767.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/regulator/s5m8767.c +5 -2
@@ -573,10 +573,13 @@ static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,"s5m8767,pmic-ext-control" ,GPIOD_OUT_HIGH |GPIOD_FLAGS_BIT_NONEXCLUSIVE , "s5m8767"); -if (PTR_ERR (rdata->ext_control_gpiod) == -ENOENT ) +if (PTR_ERR (rdata->ext_control_gpiod) == -ENOENT ) { rdata->ext_control_gpiod =NULL ; -else if (IS_ERR (rdata->ext_control_gpiod)) + }else if (IS_ERR (rdata->ext_control_gpiod)) { +of_node_put (reg_np); +of_node_put (regulators_np);return PTR_ERR (rdata->ext_control_gpiod); + } rdata->id = i; rdata->initdata = of_get_regulator_init_data(
Signature · 1 line
2.17.1
Quoted 9 lines · Pan Bian
Call
of_node_put()to drop references ofregulators_npandreg_npbefore returning error code.Fixes 9ae5cc75ceaa ("regulator: s5m8767: Pass descriptor instead of GPIO number")Signed-off-by Pan Bian <[email protected]>--- drivers/regulator/s5m8767.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
Best regards,
Krzysztof
Mark Brown
maintainerQuoted 2 lines · Pan Bian
Call
of_node_put()to drop references ofregulators_npandreg_npbefore returning error code.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
Thanks!
[1/1] regulator: s5m8767: Fix reference count leak
commit: dea6dd2ba63f8c8532addb8f32daf7b89a368a42
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark