Skip to content

Commit f30d704

Browse files
committed
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>
1 parent 0bdd5ca commit f30d704

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/aio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ static struct kioctx *lookup_ioctx(unsigned long ctx_id)
812812
goto out;
813813

814814
ctx = table->table[id];
815-
if (ctx->user_id == ctx_id) {
815+
if (ctx && ctx->user_id == ctx_id) {
816816
percpu_ref_get(&ctx->users);
817817
ret = ctx;
818818
}

0 commit comments

Comments
 (0)