X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=kernel%2Fpm_qos_params.c;h=8cb757026386f35f7f12e78cc0caef204ea93cb0;hb=db26e64dc3f0d51c4db1a625c248a81f7850eee9;hp=0afe32be4c8530851a912dde00a6ed5c0f24cf49;hpb=b691750098f830b748540cd955f5ac56545bab25;p=safe%2Fjmp%2Flinux-2.6 diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c index 0afe32b..8cb7570 100644 --- a/kernel/pm_qos_params.c +++ b/kernel/pm_qos_params.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -358,15 +359,19 @@ static int pm_qos_power_open(struct inode *inode, struct file *filp) int ret; long pm_qos_class; + lock_kernel(); pm_qos_class = find_pm_qos_object_by_minor(iminor(inode)); if (pm_qos_class >= 0) { filp->private_data = (void *)pm_qos_class; sprintf(name, "process_%d", current->pid); ret = pm_qos_add_requirement(pm_qos_class, name, PM_QOS_DEFAULT_VALUE); - if (ret >= 0) + if (ret >= 0) { + unlock_kernel(); return 0; + } } + unlock_kernel(); return -EPERM; }