pmap_page_protect() should not unmap pages after making them readonly.
authorjca <jca@openbsd.org>
Sun, 3 Sep 2023 00:03:30 +0000 (00:03 +0000)
committerjca <jca@openbsd.org>
Sun, 3 Sep 2023 00:03:30 +0000 (00:03 +0000)
This brings riscv64/pmap.c in line with arm64/pmap.c, original fix by
drahn@

ok miod@ kettenis@ mlarkin@

sys/arch/riscv64/riscv64/pmap.c

index 42e553e..069dfac 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: pmap.c,v 1.30 2023/04/13 15:23:22 miod Exp $  */
+/*     $OpenBSD: pmap.c,v 1.31 2023/09/03 00:03:30 jca Exp $   */
 
 /*
  * Copyright (c) 2019-2020 Brian Bamsch <bbamsch@google.com>
@@ -1523,6 +1523,7 @@ pmap_page_protect(struct vm_page *pg, vm_prot_t prot)
                        pmap_page_ro(pted->pted_pmap, pted->pted_va, prot);
                }
                mtx_leave(&pg->mdpage.pv_mtx);
+               return;
        }
 
        mtx_enter(&pg->mdpage.pv_mtx);