mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-04 02:56:18 +00:00
runtime: add unlock before return in sendReq
Unlock is required before return, so there need to add unlock Fixes: #4827 Signed-off-by: chmod100 <letfu@outlook.com>
This commit is contained in:
parent
7fabdf975e
commit
8220e54787
@ -2015,11 +2015,13 @@ func (k *kataAgent) sendReq(spanCtx context.Context, request interface{}) (inter
|
||||
k.Lock()
|
||||
|
||||
if k.reqHandlers == nil {
|
||||
k.Unlock()
|
||||
return nil, errors.New("Client has already disconnected")
|
||||
}
|
||||
|
||||
handler := k.reqHandlers[msgName]
|
||||
if msgName == "" || handler == nil {
|
||||
k.Unlock()
|
||||
return nil, errors.New("Invalid request type")
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user