diff options
author | Ingo Molnar <mingo@kernel.org> | 2013-12-17 15:22:35 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-12-17 15:22:35 +0100 |
commit | ffe732c2430c55074bebb172d33d909c662cd0e3 (patch) | |
tree | d39087d7b5d8caa505b23b6ea2abc2e33efa5be5 /fs/aio.c | |
parent | 40ea2b42d7c44386cf81d5636d574193da2c8df2 (diff) | |
parent | 757dfcaa41844595964f1220f1d33182dae49976 (diff) |
Merge branch 'sched/urgent' into sched/core
Merge the latest batch of fixes before applying development patches.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/aio.c')
-rw-r--r-- | fs/aio.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -367,8 +367,10 @@ static int aio_setup_ring(struct kioctx *ctx) if (nr_pages > AIO_RING_PAGES) { ctx->ring_pages = kcalloc(nr_pages, sizeof(struct page *), GFP_KERNEL); - if (!ctx->ring_pages) + if (!ctx->ring_pages) { + put_aio_ring_file(ctx); return -ENOMEM; + } } ctx->mmap_size = nr_pages * PAGE_SIZE; @@ -645,7 +647,7 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) aio_nr + nr_events < aio_nr) { spin_unlock(&aio_nr_lock); err = -EAGAIN; - goto err; + goto err_ctx; } aio_nr += ctx->max_reqs; spin_unlock(&aio_nr_lock); @@ -662,6 +664,8 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) err_cleanup: aio_nr_sub(ctx->max_reqs); +err_ctx: + aio_free_ring(ctx); err: free_percpu(ctx->cpu); free_percpu(ctx->reqs.pcpu_count); |