regulator: fix memory leak with repeated set_machine_constraints()
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: aea6cb99 ("regulator: resolve supply after creating regulator") Cc: stable@vger.kernel.org Signed-off-by: NMichał 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.plSigned-off-by: NMark Brown <broonie@kernel.org>
Showing
想要评论请 注册 或 登录