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>
This commit is contained in:
Benjamin LaHaise 2013-08-07 18:23:48 -04:00
Родитель 0bdd5ca553
Коммит f30d704fe1
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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;
}