|
@@ -174,21 +174,17 @@ static int msr_open(struct inode *inode, struct file *file)
|
|
|
{
|
|
|
unsigned int cpu = iminor(file->f_path.dentry->d_inode);
|
|
|
struct cpuinfo_x86 *c = &cpu_data(cpu);
|
|
|
- int ret = 0;
|
|
|
|
|
|
- lock_kernel();
|
|
|
cpu = iminor(file->f_path.dentry->d_inode);
|
|
|
|
|
|
- if (cpu >= nr_cpu_ids || !cpu_online(cpu)) {
|
|
|
- ret = -ENXIO; /* No such CPU */
|
|
|
- goto out;
|
|
|
- }
|
|
|
+ if (cpu >= nr_cpu_ids || !cpu_online(cpu))
|
|
|
+ return -ENXIO; /* No such CPU */
|
|
|
+
|
|
|
c = &cpu_data(cpu);
|
|
|
if (!cpu_has(c, X86_FEATURE_MSR))
|
|
|
- ret = -EIO; /* MSR not supported */
|
|
|
-out:
|
|
|
- unlock_kernel();
|
|
|
- return ret;
|
|
|
+ return -EIO; /* MSR not supported */
|
|
|
+
|
|
|
+ return 0;
|
|
|
}
|
|
|
|
|
|
/*
|