diff options
author | Jacob Moody <moody@posixcafe.org> | 2022-06-22 15:53:32 +0000 |
---|---|---|
committer | Jacob Moody <moody@posixcafe.org> | 2022-06-22 15:53:32 +0000 |
commit | 5ee86cf824c5591aa92118c0cd9d71b005e789d0 (patch) | |
tree | 0e1e62eda7c9adf5b33857e6d99d064aef0362e4 /sys/src/9/port | |
parent | fa0c807bfb50ba01c9e602de555f64e4c84e3fb1 (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.c | 5 |
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); |