shithub: plan9front

Download patch

ref: 5ee86cf824c5591aa92118c0cd9d71b005e789d0
parent: fa0c807bfb50ba01c9e602de555f64e4c84e3fb1
author: Jacob Moody <moody@posixcafe.org>
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	Tue Jun 21 09:21:38 2022
+++ b/sys/src/9/port/devsrv.c	Wed Jun 22 11:53:32 2022
@@ -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);