aboutsummaryrefslogtreecommitdiffstats
path: root/fs/timerfd.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/timerfd.c')
-rw-r--r--fs/timerfd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/timerfd.c b/fs/timerfd.c
index 77c2bc92cbee..c6ef5e33cb34 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -184,7 +184,7 @@ asmlinkage long sys_timerfd_create(int clockid, int flags)
184 int ufd; 184 int ufd;
185 struct timerfd_ctx *ctx; 185 struct timerfd_ctx *ctx;
186 186
187 if (flags) 187 if (flags & ~TFD_CLOEXEC)
188 return -EINVAL; 188 return -EINVAL;
189 if (clockid != CLOCK_MONOTONIC && 189 if (clockid != CLOCK_MONOTONIC &&
190 clockid != CLOCK_REALTIME) 190 clockid != CLOCK_REALTIME)
@@ -198,7 +198,8 @@ asmlinkage long sys_timerfd_create(int clockid, int flags)
198 ctx->clockid = clockid; 198 ctx->clockid = clockid;
199 hrtimer_init(&ctx->tmr, clockid, HRTIMER_MODE_ABS); 199 hrtimer_init(&ctx->tmr, clockid, HRTIMER_MODE_ABS);
200 200
201 ufd = anon_inode_getfd("[timerfd]", &timerfd_fops, ctx, 0); 201 ufd = anon_inode_getfd("[timerfd]", &timerfd_fops, ctx,
202 flags & O_CLOEXEC);
202 if (ufd < 0) 203 if (ufd < 0)
203 kfree(ctx); 204 kfree(ctx);
204 205