Michał Mirosław cf1f185d9e regulator: fix memory leak with repeated set_machine_constraints()
commit 57a6ad482af256b2a13de14194fb8f67c1a65f10 upstream.

Fixed commit introduced a possible second call to
set_machine_constraints() and that allocates memory for
rdev->constraints. Move the allocation to the caller so
it's easier to manage and done once.

Fixes: aea6cb99703e ("regulator: resolve supply after creating regulator")
Cc: stable@vger.kernel.org
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Tested-by: Ahmad Fatoum <a.fatoum@pengutronix.de> # stpmic1
Link: https://lore.kernel.org/r/78c3d4016cebc08d441aad18cb924b4e4d9cf9df.1605226675.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-24 13:03:08 +01:00
..
2020-11-22 09:58:15 +01:00
2020-11-10 10:23:51 +01:00
2020-11-24 13:02:52 +01:00
2020-10-29 09:05:41 +01:00
2020-10-29 09:05:39 +01:00
2020-11-10 10:23:53 +01:00
2020-02-28 15:42:33 +01:00