ioutils: fix race in access closeErr in bytespipe
Signed-off-by: Alexander Morozov <lk4d4@docker.com> Upstream-commit: b32478488ce6d373e44bb8a6c9cb986c773ad48e Component: engine
This commit is contained in:
@ -133,8 +133,9 @@ func (bp *BytesPipe) Read(p []byte) (n int, err error) {
|
||||
}
|
||||
bp.wait.Wait()
|
||||
if bp.bufLen == 0 && bp.closeErr != nil {
|
||||
err := bp.closeErr
|
||||
bp.mu.Unlock()
|
||||
return 0, bp.closeErr
|
||||
return 0, err
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user