git: 9front

Download patch

ref: ff14ee4e930834e35489e425e070d630302ccc1e
parent: 38fc62546a3e480b296f4538f99d00cbd2dcb3ff
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Jul 8 19:01:14 EDT 2023

swap: fix pager nil pointer derefence when running out of procs

--- a/sys/src/9/port/devswap.c
+++ b/sys/src/9/port/devswap.c
@@ -183,12 +183,10 @@
 
 		i = ageclock;
 		do {
-			p = proctab(x++);
-			if(p == nil){
+			while((p = proctab(x++)) == nil){
 				if(++ageclock == i)
 					goto Killbig;
 				x = 0;
-				continue;
 			}
 		} while(p->state == Dead || p->noswap || !canqlock(&p->seglock));
 		up->psstate = "Pageout";
--