Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292336
b: refs/heads/master
c: e23754f
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Mar 21, 2012
1 parent 7f0802c commit 1d1f4e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5d026c7242201e7c9d0e12fcb2bcaffead9d59fd
refs/heads/master: e23754f880f10124f0a2848f9d17e361a295378e
12 changes: 5 additions & 7 deletions trunk/fs/aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))) ||
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1d1f4e4

Please sign in to comment.