kernel: correct error handling in /srv/clone read
readstr can error, we need to catch the error and unlock.
This commit is contained in:
parent
fa0c807bfb
commit
5ee86cf824
1 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue