From b604231b13c19cfb12b2151cfb2b014b938ed01b Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 7 Mar 2012 05:16:35 +0000 Subject: [PATCH] --- yaml --- r: 288399 b: refs/heads/master c: 86b62a2cb4fc09037bbce2959d2992962396fd7f h: refs/heads/master i: 288397: 267ca730eb878043994ae4d06c450518ae25d11b 288395: ea73b43856db7ba779e55d2fa0922677ecd3e140 288391: f96cf8db3816bc8b0955909e99b5232ce82c591e 288383: 40eebdc988e6df355b971715e880e89ad2563690 v: v3 --- [refs] | 2 +- trunk/fs/aio.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 614567cece0b..c15bf10f0cc9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 86e06008338e5712603613a0f6770500f79e83bd +refs/heads/master: 86b62a2cb4fc09037bbce2959d2992962396fd7f diff --git a/trunk/fs/aio.c b/trunk/fs/aio.c index 67e4b9047cc9..f6578cb22d00 100644 --- a/trunk/fs/aio.c +++ b/trunk/fs/aio.c @@ -273,7 +273,7 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) mm = ctx->mm = current->mm; atomic_inc(&mm->mm_count); - atomic_set(&ctx->users, 1); + atomic_set(&ctx->users, 2); spin_lock_init(&ctx->ctx_lock); spin_lock_init(&ctx->ring_info.ring_lock); init_waitqueue_head(&ctx->wait); @@ -1338,10 +1338,10 @@ SYSCALL_DEFINE2(io_setup, unsigned, nr_events, aio_context_t __user *, ctxp) ret = PTR_ERR(ioctx); if (!IS_ERR(ioctx)) { ret = put_user(ioctx->user_id, ctxp); - if (!ret) + if (!ret) { + put_ioctx(ioctx); return 0; - - get_ioctx(ioctx); /* io_destroy() expects us to hold a ref */ + } io_destroy(ioctx); }