summaryrefslogtreecommitdiffstats
path: root/arch/um/kernel/trap.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2023-06-30 17:41:39 +0200
committerAndrew Morton <akpm@linux-foundation.org>2023-06-30 17:41:39 +0200
commit44f10dbefd5e41b3385af91f855a57aa2afaf40e (patch)
tree944c9f1cda8322691468e6f10dc5b0d41c487621 /arch/um/kernel/trap.c
parentMerge branch 'master' into mm-hotfixes-stable (diff)
parentcsky: fix up lock_mm_and_find_vma() conversion (diff)
downloadlinux-44f10dbefd5e41b3385af91f855a57aa2afaf40e.tar.xz
linux-44f10dbefd5e41b3385af91f855a57aa2afaf40e.zip
Merge branch 'master' into mm-hotfixes-stable
Diffstat (limited to 'arch/um/kernel/trap.c')
-rw-r--r--arch/um/kernel/trap.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/um/kernel/trap.c b/arch/um/kernel/trap.c
index d3ce21c4ca32..6d8ae86ae978 100644
--- a/arch/um/kernel/trap.c
+++ b/arch/um/kernel/trap.c
@@ -47,14 +47,15 @@ retry:
vma = find_vma(mm, address);
if (!vma)
goto out;
- else if (vma->vm_start <= address)
+ if (vma->vm_start <= address)
goto good_area;
- else if (!(vma->vm_flags & VM_GROWSDOWN))
+ if (!(vma->vm_flags & VM_GROWSDOWN))
goto out;
- else if (is_user && !ARCH_IS_STACKGROW(address))
- goto out;
- else if (expand_stack(vma, address))
+ if (is_user && !ARCH_IS_STACKGROW(address))
goto out;
+ vma = expand_stack(mm, address);
+ if (!vma)
+ goto out_nosemaphore;
good_area:
*code_out = SEGV_ACCERR;