Commit a2e1859a authored by Al Viro's avatar Al Viro

aio: take final put_ioctx() into callers of io_destroy()

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 06af121e
...@@ -1270,7 +1270,6 @@ static void io_destroy(struct kioctx *ioctx) ...@@ -1270,7 +1270,6 @@ static void io_destroy(struct kioctx *ioctx)
* locking done by the above calls to ensure this consistency. * locking done by the above calls to ensure this consistency.
*/ */
wake_up_all(&ioctx->wait); wake_up_all(&ioctx->wait);
put_ioctx(ioctx); /* once for the lookup */
} }
/* sys_io_setup: /* sys_io_setup:
...@@ -1307,11 +1306,9 @@ SYSCALL_DEFINE2(io_setup, unsigned, nr_events, aio_context_t __user *, ctxp) ...@@ -1307,11 +1306,9 @@ SYSCALL_DEFINE2(io_setup, unsigned, nr_events, aio_context_t __user *, ctxp)
ret = PTR_ERR(ioctx); ret = PTR_ERR(ioctx);
if (!IS_ERR(ioctx)) { if (!IS_ERR(ioctx)) {
ret = put_user(ioctx->user_id, ctxp); ret = put_user(ioctx->user_id, ctxp);
if (!ret) { if (ret)
put_ioctx(ioctx); io_destroy(ioctx);
return 0; put_ioctx(ioctx);
}
io_destroy(ioctx);
} }
out: out:
...@@ -1329,6 +1326,7 @@ SYSCALL_DEFINE1(io_destroy, aio_context_t, ctx) ...@@ -1329,6 +1326,7 @@ SYSCALL_DEFINE1(io_destroy, aio_context_t, ctx)
struct kioctx *ioctx = lookup_ioctx(ctx); struct kioctx *ioctx = lookup_ioctx(ctx);
if (likely(NULL != ioctx)) { if (likely(NULL != ioctx)) {
io_destroy(ioctx); io_destroy(ioctx);
put_ioctx(ioctx);
return 0; return 0;
} }
pr_debug("EINVAL: io_destroy: invalid context id\n"); pr_debug("EINVAL: io_destroy: invalid context id\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment