diff --git a/[refs] b/[refs] index 9509f872d994..9acd2d13cae1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 823d93640927d739f7c918b73fe5ec494fb27e17 +refs/heads/master: 11388c87d2abca1f01975ced28ce9eacea239104 diff --git a/trunk/kernel/power/wakelock.c b/trunk/kernel/power/wakelock.c index c8fba3380076..8f50de394d22 100644 --- a/trunk/kernel/power/wakelock.c +++ b/trunk/kernel/power/wakelock.c @@ -9,6 +9,7 @@ * manipulate wakelocks on Android. */ +#include #include #include #include @@ -188,6 +189,9 @@ int pm_wake_lock(const char *buf) size_t len; int ret = 0; + if (!capable(CAP_BLOCK_SUSPEND)) + return -EPERM; + while (*str && !isspace(*str)) str++; @@ -231,6 +235,9 @@ int pm_wake_unlock(const char *buf) size_t len; int ret = 0; + if (!capable(CAP_BLOCK_SUSPEND)) + return -EPERM; + len = strlen(buf); if (!len) return -EINVAL;