From 5ee86cf824c5591aa92118c0cd9d71b005e789d0 Mon Sep 17 00:00:00 2001 From: Jacob Moody Date: Wed, 22 Jun 2022 15:53:32 +0000 Subject: kernel: correct error handling in /srv/clone read readstr can error, we need to catch the error and unlock. --- sys/src/9/port/devsrv.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sys/src') 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); -- cgit v1.2.3