kernel: correct error handling in /srv/clone read

readstr can error, we need to catch the error and unlock.
This commit is contained in:
Jacob Moody 2022-06-22 15:53:32 +00:00
parent fa0c807bfb
commit 5ee86cf824

View file

@ -557,8 +557,13 @@ srvread(Chan *c, void *va, long n, vlong off)
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);