]> git.baikalelectronics.ru Git - kernel.git/commit
regulator: core: fix module refcount leak in set_supply()
authorYang Yingliang <yangyingliang@huawei.com>
Thu, 1 Dec 2022 12:27:05 +0000 (20:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:09 +0000 (11:41 +0100)
commitb83b441795633cd5b06329d55f505453aa51a81e
tree212323814836601da20eb88b7eefcfb6b1e17e7a
parentf922bed2c9ecc61958f608207e662e1870d68610
regulator: core: fix module refcount leak in set_supply()

[ Upstream commit da46ee19cbd8344d6860816b4827a7ce95764867 ]

If create_regulator() fails in set_supply(), the module refcount
needs be put to keep refcount balanced.

Fixes: bda86b2f092d ("regulator: core: Increase refcount for regulator supply's module")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20221201122706.4055992-2-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/regulator/core.c