diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-20 16:27:57 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-31 16:03:15 -0400 |
commit | a2e1859adb3b05fa99f87a67df9ef2a4b7b04a13 (patch) | |
tree | 2d6ba3300b595f2db3fdb3407fc2d028a7baf68a /fs | |
parent | 06af121eab543e5554f7a29538f171a382aaf855 (diff) |
aio: take final put_ioctx() into callers of io_destroy()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/aio.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -1270,7 +1270,6 @@ static void io_destroy(struct kioctx *ioctx) | |||
1270 | * locking done by the above calls to ensure this consistency. | 1270 | * locking done by the above calls to ensure this consistency. |
1271 | */ | 1271 | */ |
1272 | wake_up_all(&ioctx->wait); | 1272 | wake_up_all(&ioctx->wait); |
1273 | put_ioctx(ioctx); /* once for the lookup */ | ||
1274 | } | 1273 | } |
1275 | 1274 | ||
1276 | /* sys_io_setup: | 1275 | /* sys_io_setup: |
@@ -1307,11 +1306,9 @@ SYSCALL_DEFINE2(io_setup, unsigned, nr_events, aio_context_t __user *, ctxp) | |||
1307 | ret = PTR_ERR(ioctx); | 1306 | ret = PTR_ERR(ioctx); |
1308 | if (!IS_ERR(ioctx)) { | 1307 | if (!IS_ERR(ioctx)) { |
1309 | ret = put_user(ioctx->user_id, ctxp); | 1308 | ret = put_user(ioctx->user_id, ctxp); |
1310 | if (!ret) { | 1309 | if (ret) |
1311 | put_ioctx(ioctx); | 1310 | io_destroy(ioctx); |
1312 | return 0; | 1311 | put_ioctx(ioctx); |
1313 | } | ||
1314 | io_destroy(ioctx); | ||
1315 | } | 1312 | } |
1316 | 1313 | ||
1317 | out: | 1314 | out: |
@@ -1329,6 +1326,7 @@ SYSCALL_DEFINE1(io_destroy, aio_context_t, ctx) | |||
1329 | struct kioctx *ioctx = lookup_ioctx(ctx); | 1326 | struct kioctx *ioctx = lookup_ioctx(ctx); |
1330 | if (likely(NULL != ioctx)) { | 1327 | if (likely(NULL != ioctx)) { |
1331 | io_destroy(ioctx); | 1328 | io_destroy(ioctx); |
1329 | put_ioctx(ioctx); | ||
1332 | return 0; | 1330 | return 0; |
1333 | } | 1331 | } |
1334 | pr_debug("EINVAL: io_destroy: invalid context id\n"); | 1332 | pr_debug("EINVAL: io_destroy: invalid context id\n"); |