diff options
author | Benjamin LaHaise <bcrl@kvack.org> | 2013-08-07 18:23:48 -0400 |
---|---|---|
committer | Benjamin LaHaise <bcrl@kvack.org> | 2013-08-07 18:23:48 -0400 |
commit | f30d704fe1244c44a984d3d1f47bc648bcc6c9f7 (patch) | |
tree | e10cb0106ea097cd5e8a406f0f59e38b0e714547 /fs | |
parent | 0bdd5ca553ebc15060dd72684710e0a0af4481b4 (diff) |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/aio.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -812,7 +812,7 @@ static struct kioctx *lookup_ioctx(unsigned long ctx_id) | |||
812 | goto out; | 812 | goto out; |
813 | 813 | ||
814 | ctx = table->table[id]; | 814 | ctx = table->table[id]; |
815 | if (ctx->user_id == ctx_id) { | 815 | if (ctx && ctx->user_id == ctx_id) { |
816 | percpu_ref_get(&ctx->users); | 816 | percpu_ref_get(&ctx->users); |
817 | ret = ctx; | 817 | ret = ctx; |
818 | } | 818 | } |