summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin LaHaise <bcrl@kvack.org>2013-08-08 00:23:48 +0200
committerBenjamin LaHaise <bcrl@kvack.org>2013-08-08 00:23:48 +0200
commitf30d704fe1244c44a984d3d1f47bc648bcc6c9f7 (patch)
treee10cb0106ea097cd5e8a406f0f59e38b0e714547
parentstaging/lustre: kiocb->ki_left is removed (diff)
downloadlinux-f30d704fe1244c44a984d3d1f47bc648bcc6c9f7.tar.xz
linux-f30d704fe1244c44a984d3d1f47bc648bcc6c9f7.zip
aio: table lookup: verify ctx pointer
Another shortcoming of the table lookup patch was revealed where the pointer was not being tested before being dereferenced. Verify this to avoid the NULL pointer dereference. Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
-rw-r--r--fs/aio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/aio.c b/fs/aio.c
index 3bc068c1cb9c..c3f005dc2d55 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -812,7 +812,7 @@ static struct kioctx *lookup_ioctx(unsigned long ctx_id)
goto out;
ctx = table->table[id];
- if (ctx->user_id == ctx_id) {
+ if (ctx && ctx->user_id == ctx_id) {
percpu_ref_get(&ctx->users);
ret = ctx;
}