diff --git a/fs/aio.c b/fs/aio.c index fb92c32a6f1e..1ec5a773d09c 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -336,6 +336,9 @@ static int aio_ring_mremap(struct vm_area_struct *vma) spin_lock(&mm->ioctx_lock); rcu_read_lock(); table = rcu_dereference(mm->ioctx_table); + if (!table) + goto out_unlock; + for (i = 0; i < table->nr; i++) { struct kioctx *ctx; @@ -349,6 +352,7 @@ static int aio_ring_mremap(struct vm_area_struct *vma) } } +out_unlock: rcu_read_unlock(); spin_unlock(&mm->ioctx_lock); return res;