diff options
| -rw-r--r-- | arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c b/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c index 27937458c231..efa4a519f5e5 100644 --- a/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c +++ b/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | 23 | ||
| 24 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 24 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| 25 | 25 | ||
| 26 | #include <linux/cpu.h> | ||
| 26 | #include <linux/kernfs.h> | 27 | #include <linux/kernfs.h> |
| 27 | #include <linux/seq_file.h> | 28 | #include <linux/seq_file.h> |
| 28 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
| @@ -310,9 +311,11 @@ ssize_t rdtgroup_schemata_write(struct kernfs_open_file *of, | |||
| 310 | return -EINVAL; | 311 | return -EINVAL; |
| 311 | buf[nbytes - 1] = '\0'; | 312 | buf[nbytes - 1] = '\0'; |
| 312 | 313 | ||
| 314 | cpus_read_lock(); | ||
| 313 | rdtgrp = rdtgroup_kn_lock_live(of->kn); | 315 | rdtgrp = rdtgroup_kn_lock_live(of->kn); |
| 314 | if (!rdtgrp) { | 316 | if (!rdtgrp) { |
| 315 | rdtgroup_kn_unlock(of->kn); | 317 | rdtgroup_kn_unlock(of->kn); |
| 318 | cpus_read_unlock(); | ||
| 316 | return -ENOENT; | 319 | return -ENOENT; |
| 317 | } | 320 | } |
| 318 | rdt_last_cmd_clear(); | 321 | rdt_last_cmd_clear(); |
| @@ -367,6 +370,7 @@ ssize_t rdtgroup_schemata_write(struct kernfs_open_file *of, | |||
| 367 | 370 | ||
| 368 | out: | 371 | out: |
| 369 | rdtgroup_kn_unlock(of->kn); | 372 | rdtgroup_kn_unlock(of->kn); |
| 373 | cpus_read_unlock(); | ||
| 370 | return ret ?: nbytes; | 374 | return ret ?: nbytes; |
| 371 | } | 375 | } |
| 372 | 376 | ||
