summaryrefslogtreecommitdiff
path: root/fs/aio.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2023-02-10 15:34:48 -0800
committerAndrew Morton <akpm@linux-foundation.org>2023-02-10 15:34:48 -0800
commitf67d6b26649379f8520abe6a6c7ed335310bf01e (patch)
treec161fce6517753dcacdcea21804f6e2c90164a33 /fs/aio.c
parent223ec6ab265ead0b319bc2f15d0d1be05078a74b (diff)
parentce4d9a1ea35ac5429e822c4106cb2859d5c71f3e (diff)
Merge branch 'mm-hotfixes-stable' into mm-stable
To pick up depended-upon changes
Diffstat (limited to 'fs/aio.c')
-rw-r--r--fs/aio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/aio.c b/fs/aio.c
index 5a88caf52be4..b0b17bd098bb 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -361,6 +361,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;
@@ -374,6 +377,7 @@ static int aio_ring_mremap(struct vm_area_struct *vma)
}
}
+out_unlock:
rcu_read_unlock();
spin_unlock(&mm->ioctx_lock);
return res;