summaryrefslogtreecommitdiff
path: root/sys/src/9/port
diff options
context:
space:
mode:
authorJacob Moody <moody@posixcafe.org>2022-06-22 15:53:32 +0000
committerJacob Moody <moody@posixcafe.org>2022-06-22 15:53:32 +0000
commit5ee86cf824c5591aa92118c0cd9d71b005e789d0 (patch)
tree0e1e62eda7c9adf5b33857e6d99d064aef0362e4 /sys/src/9/port
parentfa0c807bfb50ba01c9e602de555f64e4c84e3fb1 (diff)
kernel: correct error handling in /srv/clone read
readstr can error, we need to catch the error and unlock.
Diffstat (limited to 'sys/src/9/port')
-rw-r--r--sys/src/9/port/devsrv.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/src/9/port/devsrv.c b/sys/src/9/port/devsrv.c
index f676227d4..e1b7856f9 100644
--- a/sys/src/9/port/devsrv.c
+++ b/sys/src/9/port/devsrv.c
@@ -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);