[PATCH 14/23] hwmon/coretemp: Use RCU to protect access of HK_TYPE_MISC cpumask

Waiman Long
2026-04-21T03:06:50Z

As HK_TYPE_MISC cpumask is going to be changeable at run time, use RCU
to protect access to the cpumask.

Signed-off-by: Waiman Long <longman@redhat.com>
---
drivers/hwmon/coretemp.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 6a0d94711ead..0284ea6a3b79 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -563,8 +563,10 @@ static int create_core_data(struct platform_device *pdev, unsigned int cpu,
u32 eax, edx;
int err;

- if (!housekeeping_cpu(cpu, HK_TYPE_MISC))
- return 0;
+ scoped_guard(rcu) {
+ if (!housekeeping_cpu(cpu, HK_TYPE_MISC))
+ return 0;
+ }

tdata = init_temp_data(pdata, cpu, pkg_flag);
if (!tdata)
--
2.53.0