cpufreq/pasemi: fix use-after-free in pas_cpufreq_cpu_init()
authorWen Yang <wen.yang99@zte.com.cn>
Wed, 17 Jul 2019 03:55:04 +0000 (11:55 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Aug 2019 08:12:46 +0000 (10:12 +0200)
commit8729fe83b0d56c1dabd33b61abce5c0924114b96
tree1f7970e3bec21c2bb75b3ac3d6ec1c5d6b03869c
parent991c4756be69417f720734ceb32a22071e0aa0af
cpufreq/pasemi: fix use-after-free in pas_cpufreq_cpu_init()

[ Upstream commit e0a12445d1cb186d875410d093a00d215bec6a89 ]

The cpu variable is still being used in the of_get_property() call
after the of_node_put() call, which may result in use-after-free.

Fixes: a9acc26b75f6 ("cpufreq/pasemi: fix possible object reference leak")
Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/cpufreq/pasemi-cpufreq.c