diff options
Diffstat (limited to 'fs/userfaultfd.c')
-rw-r--r-- | fs/userfaultfd.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c index 634e676072cb..50311703135b 100644 --- a/fs/userfaultfd.c +++ b/fs/userfaultfd.c | |||
@@ -467,8 +467,8 @@ static int userfaultfd_release(struct inode *inode, struct file *file) | |||
467 | * the fault_*wqh. | 467 | * the fault_*wqh. |
468 | */ | 468 | */ |
469 | spin_lock(&ctx->fault_pending_wqh.lock); | 469 | spin_lock(&ctx->fault_pending_wqh.lock); |
470 | __wake_up_locked_key(&ctx->fault_pending_wqh, TASK_NORMAL, 0, &range); | 470 | __wake_up_locked_key(&ctx->fault_pending_wqh, TASK_NORMAL, &range); |
471 | __wake_up_locked_key(&ctx->fault_wqh, TASK_NORMAL, 0, &range); | 471 | __wake_up_locked_key(&ctx->fault_wqh, TASK_NORMAL, &range); |
472 | spin_unlock(&ctx->fault_pending_wqh.lock); | 472 | spin_unlock(&ctx->fault_pending_wqh.lock); |
473 | 473 | ||
474 | wake_up_poll(&ctx->fd_wqh, POLLHUP); | 474 | wake_up_poll(&ctx->fd_wqh, POLLHUP); |
@@ -650,10 +650,10 @@ static void __wake_userfault(struct userfaultfd_ctx *ctx, | |||
650 | spin_lock(&ctx->fault_pending_wqh.lock); | 650 | spin_lock(&ctx->fault_pending_wqh.lock); |
651 | /* wake all in the range and autoremove */ | 651 | /* wake all in the range and autoremove */ |
652 | if (waitqueue_active(&ctx->fault_pending_wqh)) | 652 | if (waitqueue_active(&ctx->fault_pending_wqh)) |
653 | __wake_up_locked_key(&ctx->fault_pending_wqh, TASK_NORMAL, 0, | 653 | __wake_up_locked_key(&ctx->fault_pending_wqh, TASK_NORMAL, |
654 | range); | 654 | range); |
655 | if (waitqueue_active(&ctx->fault_wqh)) | 655 | if (waitqueue_active(&ctx->fault_wqh)) |
656 | __wake_up_locked_key(&ctx->fault_wqh, TASK_NORMAL, 0, range); | 656 | __wake_up_locked_key(&ctx->fault_wqh, TASK_NORMAL, range); |
657 | spin_unlock(&ctx->fault_pending_wqh.lock); | 657 | spin_unlock(&ctx->fault_pending_wqh.lock); |
658 | } | 658 | } |
659 | 659 | ||
@@ -1287,8 +1287,10 @@ static struct file *userfaultfd_file_create(int flags) | |||
1287 | 1287 | ||
1288 | file = anon_inode_getfile("[userfaultfd]", &userfaultfd_fops, ctx, | 1288 | file = anon_inode_getfile("[userfaultfd]", &userfaultfd_fops, ctx, |
1289 | O_RDWR | (flags & UFFD_SHARED_FCNTL_FLAGS)); | 1289 | O_RDWR | (flags & UFFD_SHARED_FCNTL_FLAGS)); |
1290 | if (IS_ERR(file)) | 1290 | if (IS_ERR(file)) { |
1291 | mmput(ctx->mm); | ||
1291 | kmem_cache_free(userfaultfd_ctx_cachep, ctx); | 1292 | kmem_cache_free(userfaultfd_ctx_cachep, ctx); |
1293 | } | ||
1292 | out: | 1294 | out: |
1293 | return file; | 1295 | return file; |
1294 | } | 1296 | } |