Commit da5dce5c authored by Steven Whitehouse's avatar Steven Whitehouse Committed by Linus Torvalds

[PATCH] Trivial fix to aio.c:__aio_get_req()

This is a simple fix to aio.c:__aio_get_req() where it appears that
a freed aio request could be incorrectly returned in the error path,
parent 6e7aa9f0
...@@ -400,8 +400,10 @@ static struct kiocb *__aio_get_req(struct kioctx *ctx) ...@@ -400,8 +400,10 @@ static struct kiocb *__aio_get_req(struct kioctx *ctx)
req->ki_user_obj = NULL; req->ki_user_obj = NULL;
req->ki_ctx = ctx; req->ki_ctx = ctx;
req->ki_users = 1; req->ki_users = 1;
} else } else {
kmem_cache_free(kiocb_cachep, req); kmem_cache_free(kiocb_cachep, req);
req = NULL;
}
kunmap_atomic(ring, KM_USER0); kunmap_atomic(ring, KM_USER0);
spin_unlock_irq(&ctx->ctx_lock); spin_unlock_irq(&ctx->ctx_lock);
......
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