]> git.baikalelectronics.ru Git - kernel.git/commit
regulator: fix use after free issue
authorWen Yang <wenyang@linux.alibaba.com>
Sun, 24 Nov 2019 14:58:35 +0000 (22:58 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 27 Nov 2019 12:53:48 +0000 (12:53 +0000)
commitcfd00ee650e7a23819c19344177f369604cc2ee3
treebb42d14a7ee8ee531d8332ad4280b1747aeaf371
parente97925f5dd82037c8a160a265718a9f169cbe786
regulator: fix use after free issue

This is caused by dereferencing 'rdev' after put_device() in
the _regulator_get()/_regulator_put() functions.
This patch just moves the put_device() down a bit to avoid the
issue.

Signed-off-by: Wen Yang <wenyang@linux.alibaba.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: linux-kernel@vger.kernel.org
Link: https://lore.kernel.org/r/20191124145835.25999-1-wenyang@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/core.c