aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/pm_qos_params.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c
index 0afe32be4c85..8cb757026386 100644
--- a/kernel/pm_qos_params.c
+++ b/kernel/pm_qos_params.c
@@ -29,6 +29,7 @@
29 29
30#include <linux/pm_qos_params.h> 30#include <linux/pm_qos_params.h>
31#include <linux/sched.h> 31#include <linux/sched.h>
32#include <linux/smp_lock.h>
32#include <linux/spinlock.h> 33#include <linux/spinlock.h>
33#include <linux/slab.h> 34#include <linux/slab.h>
34#include <linux/time.h> 35#include <linux/time.h>
@@ -358,15 +359,19 @@ static int pm_qos_power_open(struct inode *inode, struct file *filp)
358 int ret; 359 int ret;
359 long pm_qos_class; 360 long pm_qos_class;
360 361
362 lock_kernel();
361 pm_qos_class = find_pm_qos_object_by_minor(iminor(inode)); 363 pm_qos_class = find_pm_qos_object_by_minor(iminor(inode));
362 if (pm_qos_class >= 0) { 364 if (pm_qos_class >= 0) {
363 filp->private_data = (void *)pm_qos_class; 365 filp->private_data = (void *)pm_qos_class;
364 sprintf(name, "process_%d", current->pid); 366 sprintf(name, "process_%d", current->pid);
365 ret = pm_qos_add_requirement(pm_qos_class, name, 367 ret = pm_qos_add_requirement(pm_qos_class, name,
366 PM_QOS_DEFAULT_VALUE); 368 PM_QOS_DEFAULT_VALUE);
367 if (ret >= 0) 369 if (ret >= 0) {
370 unlock_kernel();
368 return 0; 371 return 0;
372 }
369 } 373 }
374 unlock_kernel();
370 375
371 return -EPERM; 376 return -EPERM;
372} 377}