diff --git a/fs/aio.c b/fs/aio.c index 3bc068c1cb9cbfaec0e33dfe5efd26ec361e2c93..c3f005dc2d55211ea055ad8ccc9715a76eff24ac 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; }