提交 f30d704f 编写于 作者: B Benjamin LaHaise

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: NBenjamin LaHaise <bcrl@kvack.org>
上级 0bdd5ca5
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册