]> git.baikalelectronics.ru Git - kernel.git/commit
regulator: core: Fix memory leak in regulator_resolve_supply()
authorJavier Martinez Canillas <javier@osg.samsung.com>
Wed, 15 Jul 2015 14:10:29 +0000 (16:10 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 16 Jul 2015 20:38:59 +0000 (21:38 +0100)
commitba46a94f66a311337b4581063e1cc2de95bd1cbd
tree2b7bf7c9648986cfd7947d80e851a27dbdf7b247
parentf3540b73464b224c5ff4f6496e5cf71c93e4f3b7
regulator: core: Fix memory leak in regulator_resolve_supply()

The regulator_resolve_supply() function calls set_supply() which in turn
calls create_regulator() to allocate a supply regulator.

If an error occurs after set_supply() succeeded, the allocated regulator
has to be freed before propagating the error code.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/core.c