shithub: riscv

Download patch

ref: 5ee86cf824c5591aa92118c0cd9d71b005e789d0
parent: fa0c807bfb50ba01c9e602de555f64e4c84e3fb1
author: Jacob Moody <[email protected]>
date: Wed Jun 22 11:53:32 EDT 2022

kernel: correct error handling in /srv/clone read

readstr can error, we need to catch the error and unlock.

--- a/sys/src/9/port/devsrv.c
+++ b/sys/src/9/port/devsrv.c
@@ -557,8 +557,13 @@
 	if(NETTYPE(c->qid.path) == Qlease){
 		b = c->aux;
 		rlock(b);
+		if(waserror()){
+			runlock(b);
+			nexterror();
+		}
 		n = readstr((ulong)off, va, n, b->name);
 		runlock(b);
+		poperror();
 		return n;
 	}
 	isdir(c);