diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2017-04-06 02:07:33 -0400 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-04-06 02:07:33 -0400 |
| commit | 054838bc019c90511d034fb796dc8c7715460fc2 (patch) | |
| tree | a04b9fa86e3cfb8adb285fcd33bd47983f75d8fb /fs/timerfd.c | |
| parent | d597580d373774b1bdab84b3d26ff0b55162b916 (diff) | |
| parent | fc69910f329d61821897871e0e957eda39beb3d8 (diff) | |
Merge commit 'fc69910f329d' into uaccess.mips
backmerge of a build fix from mainline
Diffstat (limited to 'fs/timerfd.c')
| -rw-r--r-- | fs/timerfd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/timerfd.c b/fs/timerfd.c index 384fa759a563..c543cdb5f8ed 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c @@ -400,9 +400,9 @@ SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flags) clockid != CLOCK_BOOTTIME_ALARM)) return -EINVAL; - if (!capable(CAP_WAKE_ALARM) && - (clockid == CLOCK_REALTIME_ALARM || - clockid == CLOCK_BOOTTIME_ALARM)) + if ((clockid == CLOCK_REALTIME_ALARM || + clockid == CLOCK_BOOTTIME_ALARM) && + !capable(CAP_WAKE_ALARM)) return -EPERM; ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); @@ -449,7 +449,7 @@ static int do_timerfd_settime(int ufd, int flags, return ret; ctx = f.file->private_data; - if (!capable(CAP_WAKE_ALARM) && isalarm(ctx)) { + if (isalarm(ctx) && !capable(CAP_WAKE_ALARM)) { fdput(f); return -EPERM; } |
