From: Steven Whitehouse Date: Mon, 7 Oct 2002 02:26:58 +0000 (-0700) Subject: [PATCH] Trivial fix to aio.c:__aio_get_req() X-Git-Tag: v2.5.41~6 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=da5dce5c02b5872e76f780f0866b5d82f6fd6f80;p=history.git [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, --- diff --git a/fs/aio.c b/fs/aio.c index 80a1d3933c7a..4104a65e1172 100644 --- 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);