]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Trivial fix to aio.c:__aio_get_req()
authorSteven Whitehouse <steve@gw.chygwyn.com>
Mon, 7 Oct 2002 02:26:58 +0000 (19:26 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Mon, 7 Oct 2002 02:26:58 +0000 (19:26 -0700)
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,

fs/aio.c

index 80a1d3933c7a62913e90da909392f798ef085548..4104a65e1172e3047096c548e82084fba47f528f 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -400,8 +400,10 @@ static struct kiocb *__aio_get_req(struct kioctx *ctx)
                req->ki_user_obj = NULL;
                req->ki_ctx = ctx;
                req->ki_users = 1;
-       } else
+       } else {
                kmem_cache_free(kiocb_cachep, req);
+               req = NULL;
+       }
        kunmap_atomic(ring, KM_USER0);
        spin_unlock_irq(&ctx->ctx_lock);