mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-26 23:38:31 +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
587c0c5e55
commit
d8ad16a34e
@ -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