]> 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)
commit4affd79a125ac91e6a53be843ea3960a8fc00cbb
treebb42d14a7ee8ee531d8332ad4280b1747aeaf371
parentc15d5a645875bc9b89f68f5d3fb608f691ac78d7
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