diff --git a/[refs] b/[refs] index 203b88eb357b..16d8526e2d68 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5d026c7242201e7c9d0e12fcb2bcaffead9d59fd +refs/heads/master: e23754f880f10124f0a2848f9d17e361a295378e diff --git a/trunk/fs/aio.c b/trunk/fs/aio.c index b9d64d89a043..d09b56090aa5 100644 --- a/trunk/fs/aio.c +++ b/trunk/fs/aio.c @@ -248,6 +248,7 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) struct mm_struct *mm; struct kioctx *ctx; int did_sync = 0; + int err = -ENOMEM; /* Prevent overflows */ if ((nr_events > (0x10000000U / sizeof(struct io_event))) || @@ -310,16 +311,13 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) return ctx; out_cleanup: - __put_ioctx(ctx); - return ERR_PTR(-EAGAIN); - + err = -EAGAIN; + aio_free_ring(ctx); out_freectx: mmdrop(mm); kmem_cache_free(kioctx_cachep, ctx); - ctx = ERR_PTR(-ENOMEM); - - dprintk("aio: error allocating ioctx %p\n", ctx); - return ctx; + dprintk("aio: error allocating ioctx %d\n", err); + return ERR_PTR(err); } /* aio_cancel_all