]> git.ipfire.org Git - thirdparty/linux.git/commit
regulator: max20086: Fix refcount leak in max20086_parse_regulators_dt()
authorDan Carpenter <dan.carpenter@linaro.org>
Tue, 27 May 2025 05:44:14 +0000 (08:44 +0300)
committerMark Brown <broonie@kernel.org>
Sun, 8 Jun 2025 22:29:48 +0000 (23:29 +0100)
commit06118ae36855b7d3d22688298e74a766ccf0cb7a
tree3cca72e4e8b6a981ff6a91ab3ef3be40f5e10fa1
parent19272b37aa4f83ca52bdf9c16d5d81bdd1354494
regulator: max20086: Fix refcount leak in max20086_parse_regulators_dt()

There is a missing call to of_node_put() if devm_kcalloc() fails.
Fix this by changing the code to use cleanup.h magic to drop the
refcount.

Fixes: 6b0cd72757c6 ("regulator: max20086: fix invalid memory access")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/aDVRLqgJWMxYU03G@stanley.mountain
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/max20086-regulator.c