OPP: Protect dev_list with opp_table lock
authorViresh Kumar <viresh.kumar@linaro.org>
Fri, 3 Aug 2018 01:35:21 +0000 (07:05 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Nov 2019 17:00:13 +0000 (18:00 +0100)
commit714ab224a8db6e8255c61a42613de9349ceb0bba
tree1d665f2c18b78eb1ccb7457e6c123addaa82fc95
parent7dbc3efb7430abdddf0be186bd0ad2611d767d23
OPP: Protect dev_list with opp_table lock

[ Upstream commit 3d2556992a878a2210d3be498416aee39e0c32aa ]

The dev_list needs to be protected with a lock, else we may have
simultaneous access (addition/removal) to it and that would be racy.
Extend scope of the opp_table lock to protect dev_list as well.

Tested-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/base/power/opp/core.c
drivers/base/power/opp/cpu.c
drivers/base/power/opp/opp.h